Commit c65e3d58 authored by Michal Čihař's avatar Michal Čihař

Track auto translation changes per unit

Creating unit is not that expensive and we need this information.
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 46af0b3c
...@@ -23,7 +23,6 @@ from django.core.exceptions import PermissionDenied ...@@ -23,7 +23,6 @@ from django.core.exceptions import PermissionDenied
def auto_translate(user, translation, source, inconsistent, overwrite): def auto_translate(user, translation, source, inconsistent, overwrite):
change = None
updated = 0 updated = 0
if inconsistent: if inconsistent:
...@@ -65,13 +64,12 @@ def auto_translate(user, translation, source, inconsistent, overwrite): ...@@ -65,13 +64,12 @@ def auto_translate(user, translation, source, inconsistent, overwrite):
unit.fuzzy = update.fuzzy unit.fuzzy = update.fuzzy
unit.target = update.target unit.target = update.target
# Create signle change object for whole merge # Create signle change object for whole merge
if change is None: change = Change.objects.create(
change = Change.objects.create( action=Change.ACTION_AUTO,
action=Change.ACTION_AUTO, unit=unit,
translation=unit.translation, user=user,
user=user, author=user
author=user )
)
# Save unit to backend # Save unit to backend
unit.save_backend(None, False, False, user=user) unit.save_backend(None, False, False, user=user)
updated += 1 updated += 1
......
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