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

Simplify variable name

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 9453bb91
......@@ -185,7 +185,7 @@
{% if not unit.only_vote_suggestions or perms.trans.override_suggestion %}
{% if perms.trans.accept_suggestion %}
<button type="submit" class="btn btn-success btn-xs" name="accept" value="{{ suggestion.id }}"><i class="fa fa-check"></i> {% trans "Accept" %}</button>
<button type="submit" class="btn btn-warning btn-xs" name="accept-edit" value="{{ suggestion.id }}"><i class="fa fa-pencil"></i> {% trans "Accept and edit" %}</button>
<button type="submit" class="btn btn-warning btn-xs" name="accept_edit" value="{{ suggestion.id }}"><i class="fa fa-pencil"></i> {% trans "Accept and edit" %}</button>
{% endif %}
{% if perms.trans.delete_suggestion %}
<button type="submit" class="btn btn-danger btn-xs" name="delete" value="{{ suggestion.id }}"><i class="fa fa-trash"></i> {% trans "Delete" %}</button>
......
......@@ -407,7 +407,7 @@ def handle_suggestions(translation, request, this_unit_url, next_unit_url):
Handles suggestion deleting/accepting.
'''
sugid = ''
params = ('accept', 'accept-edit', 'delete', 'upvote', 'downvote')
params = ('accept', 'accept_edit', 'delete', 'upvote', 'downvote')
redirect_url = this_unit_url
# Parse suggestion ID
......@@ -420,7 +420,7 @@ def handle_suggestions(translation, request, this_unit_url, next_unit_url):
sugid = int(sugid)
suggestion = Suggestion.objects.get(pk=sugid)
if 'accept' in request.POST or 'accept-edit' in request.POST:
if 'accept' in request.POST or 'accept_edit' in request.POST:
# Accept suggesion
if not request.user.has_perm('trans.accept_suggestion'):
messages.error(
......@@ -514,7 +514,7 @@ def translate(request, project, subproject, lang):
# Handle accepting/deleting suggestions
if ('accept' not in request.POST and
'accept-edit' not in request.POST and
'accept_edit' not in request.POST and
'delete' not in request.POST and
'upvote' not in request.POST and
'downvote' not in request.POST):
......
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