Commit 8fe9908b authored by Michal Čihař's avatar Michal Čihař

Simplify code for setting commit message

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent d7d2ff93
......@@ -304,13 +304,12 @@ def handle_translate(translation, request, user_locked,
)
elif not user_locked:
# Custom commit message
if ('commit_message' in request.POST
and request.POST['commit_message']
!= unit.translation.commit_message):
message = requst.POST.get('commit_message')
if message and message != unit.translation.commit_message):
# Commit pending changes so that they don't get new message
unit.translation.commit_pending(request, request.user)
# Store new commit message
unit.translation.commit_message = request.POST['commit_message']
unit.translation.commit_message = message
unit.translation.save()
go_next = perform_translation(unit, form, request)
......
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