diff --git a/openslides/application/templates/application/poll_view.html b/openslides/application/templates/application/poll_view.html index 37e13cd1f..75246d0c8 100644 --- a/openslides/application/templates/application/poll_view.html +++ b/openslides/application/templates/application/poll_view.html @@ -29,9 +29,12 @@

{{ options.0.form.undesided.errors }}{{ options.0.form.undesided }}

-

+

{{ form.invalid.errors }}{{ form.invalid }}

+

+ {{ form.votescast.errors }}{{ form.votescast }} +

diff --git a/openslides/application/views.py b/openslides/application/views.py index 69c098618..8053ce6da 100644 --- a/openslides/application/views.py +++ b/openslides/application/views.py @@ -20,7 +20,7 @@ from openslides.application.models import Application from openslides.application.forms import ApplicationForm, \ ApplicationManagerForm from openslides.poll.models import Poll -from openslides.poll.forms import OptionResultForm, PollInvalidForm +from openslides.poll.forms import OptionResultForm, PollForm from openslides.utils.utils import template, permission_required, \ render_to_forbitten, del_confirm_form from openslides.utils.pdf import print_application, print_application_poll @@ -322,9 +322,10 @@ def view_poll(request, poll_id): options = poll.options if request.user.has_perm('application.can_manage_applications'): if request.method == 'POST': - form = PollInvalidForm(request.POST, prefix="poll") + form = PollForm(request.POST, prefix="poll") if form.is_valid(): poll.votesinvalid = form.cleaned_data['invalid'] or 0 + poll.votescast = form.cleaned_data['votescast'] or 0 poll.save() for option in options: @@ -337,7 +338,7 @@ def view_poll(request, poll_id): cleaned_data['undesided'] or 0 option.save() else: - form = PollInvalidForm(initial={'invalid': poll.votesinvalid}, prefix="poll") + form = PollForm(initial={'invalid': poll.votesinvalid, 'votescast': poll.votescast}, prefix="poll") for option in options: option.form = OptionResultForm(initial={ 'yes': option.voteyes, diff --git a/openslides/assignment/templates/assignment/poll_view.html b/openslides/assignment/templates/assignment/poll_view.html index e2c3d47b2..bd96cf983 100644 --- a/openslides/assignment/templates/assignment/poll_view.html +++ b/openslides/assignment/templates/assignment/poll_view.html @@ -33,9 +33,12 @@ {% endfor %} - + {{ form.invalid.errors }}{{ form.invalid }} + + {{ form.votescast.errors }}{{ form.votescast }} + {% if perms.poll.can_manage_poll %}