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
def auto_translate(user, translation, source, inconsistent, overwrite):
change = None
updated = 0
if inconsistent:
......@@ -65,13 +64,12 @@ def auto_translate(user, translation, source, inconsistent, overwrite):
unit.fuzzy = update.fuzzy
unit.target = update.target
# Create signle change object for whole merge
if change is None:
change = Change.objects.create(
action=Change.ACTION_AUTO,
translation=unit.translation,
user=user,
author=user
)
change = Change.objects.create(
action=Change.ACTION_AUTO,
unit=unit,
user=user,
author=user
)
# Save unit to backend
unit.save_backend(None, False, False, user=user)
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