From f0f14861e8b7414c24e6d2e316f9fe9ef3deaf75 Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Thu, 13 Sep 2012 21:51:50 +0200 Subject: [PATCH] fixed message for unblocking users --- openslides/assignment/views.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/openslides/assignment/views.py b/openslides/assignment/views.py index 4413a1c05..26a7a0bf5 100644 --- a/openslides/assignment/views.py +++ b/openslides/assignment/views.py @@ -193,7 +193,9 @@ def delrun(request, assignment_id): except Exception, e: messages.error(request, e) else: - messages.success(request, _("You have withdrawn your candidature successfully.") ) + messages.success(request, + _("You have withdrawn your candidature successfully. " + "You can not be nominated by other participants anymore.")) else: messages.error(request, _('The candidate list is already closed.')) @@ -204,6 +206,7 @@ def delrun(request, assignment_id): def delother(request, assignment_id, user_id): assignment = Assignment.objects.get(pk=assignment_id) person = get_person(user_id) + is_blocked = assignment.is_blocked(person) if request.method == 'POST': try: @@ -211,11 +214,17 @@ def delother(request, assignment_id, user_id): except Exception, e: messages.error(request, e) else: - messages.success(request, _("Candidate %s was withdrawn successfully.") % (person)) + if not is_blocked: + message = _("Candidate %s was withdrawn successfully.") % person + else: + message = _("%s was unblocked successfully.") % person + messages.success(request, message) else: - gen_confirm_form(request, - _("Do you really want to withdraw %s from the election?") \ - % person, reverse('assignment_delother', args=[assignment_id, user_id])) + if not is_blocked: + message = _("Do you really want to withdraw %s from the election?") % person + else: + message = _("Do you really want to unblock %s from the election?") % person + gen_confirm_form(request, message, reverse('assignment_delother', args=[assignment_id, user_id])) return redirect(reverse('assignment_view', args=[assignment_id]))