Skip to content

Commit

Permalink
fix(add-ons): execute repository scoped add-ons only once
Browse files Browse the repository at this point in the history
These should not be executed on linked components, but only on the main
one. This is generic solution to the problem replacing previous specific
solution to single event and add-on.

Fixes #12232
Fixes #10892
  • Loading branch information
nijel committed Aug 9, 2024
1 parent 54a0a87 commit 438073f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions weblate/addons/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@ def execute_addon_event(
method: str | Callable,
args: tuple | None = None,
) -> None:
# Trigger repository scoped add-ons only on the main component
if addon.repo_scope and component.linked_component:
return

# Log logging result and error flag for add-on activity log
log_result = None
error_occurred = False
Expand Down

0 comments on commit 438073f

Please sign in to comment.