Commit 41642ce7 authored by Michal Čihař's avatar Michal Čihař

Do not generate change objects for automatic translations

parent facdaf5a
...@@ -691,7 +691,7 @@ class Unit(models.Model): ...@@ -691,7 +691,7 @@ class Unit(models.Model):
return ret return ret
def save_backend(self, request, propagate = True): def save_backend(self, request, propagate = True, gen_change = True):
# Store to backend # Store to backend
(saved, pounit) = self.translation.update_unit(self, request) (saved, pounit) = self.translation.update_unit(self, request)
self.translated = pounit.istranslated() self.translated = pounit.istranslated()
...@@ -705,7 +705,8 @@ class Unit(models.Model): ...@@ -705,7 +705,8 @@ class Unit(models.Model):
# Force commiting on completing translation # Force commiting on completing translation
if old_translated < self.translation.translated and self.translation.translated == self.translation.total: if old_translated < self.translation.translated and self.translation.translated == self.translation.total:
self.translation.commit_pending() self.translation.commit_pending()
Change.objects.create(unit = self, user = request.user) if gen_change:
Change.objects.create(unit = self, user = request.user)
# Propagate to other projects # Propagate to other projects
if propagate: if propagate:
allunits = Unit.objects.same(self).exclude(id = self.id) allunits = Unit.objects.same(self).exclude(id = self.id)
......
...@@ -161,7 +161,7 @@ def auto_translation(request, project, subproject, lang): ...@@ -161,7 +161,7 @@ def auto_translation(request, project, subproject, lang):
update = update[0] update = update[0]
unit.fuzzy = update.fuzzy unit.fuzzy = update.fuzzy
unit.target = update.target unit.target = update.target
unit.save_backend(request, False) unit.save_backend(request, False, False)
messages.add_message(request, messages.INFO, _('Automatic translation completed.')) messages.add_message(request, messages.INFO, _('Automatic translation completed.'))
else: else:
messages.add_message(request, messages.ERROR, _('Failed to process form!')) messages.add_message(request, messages.ERROR, _('Failed to process form!'))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment