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

Avoid passing request to auto translation

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 0e8a9fca
...@@ -22,7 +22,7 @@ from weblate.trans.models import Unit, Change, SubProject ...@@ -22,7 +22,7 @@ from weblate.trans.models import Unit, Change, SubProject
from django.core.exceptions import PermissionDenied from django.core.exceptions import PermissionDenied
def auto_translate(request, translation, source, inconsistent, overwrite): def auto_translate(user, translation, source, inconsistent, overwrite):
change = None change = None
updated = 0 updated = 0
...@@ -69,11 +69,11 @@ def auto_translate(request, translation, source, inconsistent, overwrite): ...@@ -69,11 +69,11 @@ def auto_translate(request, translation, source, inconsistent, overwrite):
change = Change.objects.create( change = Change.objects.create(
action=Change.ACTION_AUTO, action=Change.ACTION_AUTO,
translation=unit.translation, translation=unit.translation,
user=request.user, user=user,
author=request.user author=user
) )
# Save unit to backend # Save unit to backend
unit.save_backend(request, False, False) unit.save_backend(None, False, False, user=user)
updated += 1 updated += 1
return updated return updated
...@@ -615,7 +615,7 @@ def auto_translation(request, project, subproject, lang): ...@@ -615,7 +615,7 @@ def auto_translation(request, project, subproject, lang):
return redirect(translation) return redirect(translation)
updated = auto_translate( updated = auto_translate(
request, request.user,
translation, translation,
autoform.cleaned_data['subproject'], autoform.cleaned_data['subproject'],
autoform.cleaned_data['inconsistent'], autoform.cleaned_data['inconsistent'],
......
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