From 3fc42c6488ed9feaeae913e09d44874bdb1bce87 Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Sun, 4 Sep 2011 10:43:25 +0200 Subject: [PATCH] Added revision confirm dialog. --- openslides/application/views.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openslides/application/views.py b/openslides/application/views.py index d9820a5ef..3ae1e6963 100644 --- a/openslides/application/views.py +++ b/openslides/application/views.py @@ -22,7 +22,7 @@ from openslides.application.forms import ApplicationForm, \ from openslides.poll.models import Poll from openslides.poll.forms import OptionResultForm, PollForm from openslides.utils.utils import template, permission_required, \ - render_to_forbitten, del_confirm_form + render_to_forbitten, del_confirm_form, gen_confirm_form from openslides.utils.pdf import print_application, print_application_poll from openslides.system.api import config_get @@ -362,8 +362,12 @@ def view_poll(request, poll_id): def permit_version(request, aversion_id): aversion = AVersion.objects.get(pk=aversion_id) application = aversion.application - application.accept_version(aversion) - messages.success(request, _("Version accepted") ) + + if request.method == 'POST': + application.accept_version(aversion) + messages.success(request, _("Version %s accepted.") % (aversion.aid)) + else: + gen_confirm_form(request, _('Do you really want to permit version %s?') % aversion.aid, reverse('application_version_permit', args=[aversion.id])) return redirect(reverse('application_view', args=[application.id]))