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
from django.core.exceptions import PermissionDenied
def auto_translate(request, translation, source, inconsistent, overwrite):
def auto_translate(user, translation, source, inconsistent, overwrite):
change = None
updated = 0
......@@ -69,11 +69,11 @@ def auto_translate(request, translation, source, inconsistent, overwrite):
change = Change.objects.create(
action=Change.ACTION_AUTO,
translation=unit.translation,
user=request.user,
author=request.user
user=user,
author=user
)
# Save unit to backend
unit.save_backend(request, False, False)
unit.save_backend(None, False, False, user=user)
updated += 1
return updated
......@@ -615,7 +615,7 @@ def auto_translation(request, project, subproject, lang):
return redirect(translation)
updated = auto_translate(
request,
request.user,
translation,
autoform.cleaned_data['subproject'],
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