From 63d03209c9cb142e8a86d941ba3de4b97523e4aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 26 Mar 2024 15:07:00 +0100 Subject: [PATCH] project: evaluate generator when performing operations The expected outcome here is to perform the operation on all of the components while all(generator) would only run then until first fails. The any(generator) branch works as expected as it is used for status checking. Fixes #11282 --- docs/changes.rst | 1 + weblate/trans/models/project.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/changes.rst b/docs/changes.rst index 31713c777c77..9525753a4722 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -13,6 +13,7 @@ Released on March 26th 2024. * :ref:`mt-deepl` gracefully handles glossaries for language variants. * :doc:`/formats/excel` better handles blank cells. * Fixed possible data loss when merging gettext PO file changes in Git. +* Repository operations on project could have skipped some components. **Upgrading** diff --git a/weblate/trans/models/project.py b/weblate/trans/models/project.py index db7faae275cc..e15c66a781ad 100644 --- a/weblate/trans/models/project.py +++ b/weblate/trans/models/project.py @@ -374,7 +374,9 @@ def on_repo_components(self, use_all: bool, func: str, *args, **kwargs): for component in self.all_repo_components ) if use_all: - return all(generator) + # Call methods on all components as this performs an operation + return all(list(generator)) + # This is status checking, call only needed methods return any(generator) def commit_pending(self, reason, user):