Skip to content

Commit

Permalink
Always save the project as well when saving translations
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Jul 12, 2024
1 parent ba54fc7 commit 07a859a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion projects/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ def update(self, catalog, *, request):

catalog.pofile = str(catalog.po)
catalog.save()
catalog.project.save()

else:
messages.info(request, _("No changes detected."))
Expand Down
6 changes: 6 additions & 0 deletions projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ def __str__(self):
f"{self.get_language_code_display()}, {self.domain} ({percent_translated})"
)

def save(self, *args, **kwargs):
super().save(*args, **kwargs)
self.project.save()

save.alters_data = True

def get_absolute_url(self):
return reverse(
"projects:catalog",
Expand Down

0 comments on commit 07a859a

Please sign in to comment.