Skip to content

Commit

Permalink
Merge branch 'main' into 11085_bilingual_file_upload
Browse files Browse the repository at this point in the history
  • Loading branch information
gersona authored Oct 8, 2024
2 parents afca3de + b264d2f commit fdcee40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 4 additions & 3 deletions weblate/addons/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,10 @@ def post_update(
self, component: Component, previous_head: str, skip_push: bool
) -> None:
# Ignore file parse error, it will be properly tracked as an alert
with suppress(FileParseError):
self.update_translations(component, previous_head)
self.commit_and_push(component, skip_push=skip_push)
with component.repository.lock:
with suppress(FileParseError):
self.update_translations(component, previous_head)
self.commit_and_push(component, skip_push=skip_push)


class StoreBaseAddon(BaseAddon):
Expand Down
5 changes: 4 additions & 1 deletion weblate/trans/models/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,12 @@
from weblate.vcs.ssh import add_host_key

if TYPE_CHECKING:
from collections.abc import Iterable
from datetime import datetime

from weblate.addons.models import Addon
from weblate.auth.models import AuthenticatedHttpRequest, User
from weblate.checks.base import BaseCheck
from weblate.trans.models import Unit

NEW_LANG_CHOICES = (
Expand Down Expand Up @@ -3747,14 +3749,15 @@ def _schedule_sync_terminology(self) -> None:
for glossary in self.project.glossaries:
sync_glossary_languages.delay(glossary.pk)

def get_unused_enforcements(self):
def get_unused_enforcements(self) -> Iterable[dict | BaseCheck]:
from weblate.trans.models import Unit

for current in self.enforced_checks:
try:
check = CHECKS[current]
except KeyError:
yield {"name": current, "notsupported": True}
continue
# Check is always enabled
if not check.default_disabled:
continue
Expand Down

0 comments on commit fdcee40

Please sign in to comment.