DB change: Changed voteinvalid to votesinvalid.

This commit is contained in:
Emanuel Schuetze 2011-09-03 00:43:09 +02:00
parent f24cc7c0c1
commit 2278ddca54
4 changed files with 6 additions and 6 deletions

View File

@ -323,7 +323,7 @@ def view_poll(request, poll_id):
if request.method == 'POST':
form = PollInvalidForm(request.POST, prefix="poll")
if form.is_valid():
poll.voteinvalid = form.cleaned_data['invalid'] or 0
poll.votesinvalid = form.cleaned_data['invalid'] or 0
poll.save()
for option in options:
@ -336,7 +336,7 @@ def view_poll(request, poll_id):
cleaned_data['undesided'] or 0
option.save()
else:
form = PollInvalidForm(initial={'invalid': poll.voteinvalid}, prefix="poll")
form = PollInvalidForm(initial={'invalid': poll.votesinvalid}, prefix="poll")
for option in options:
option.form = OptionResultForm(initial={
'yes': option.voteyes,

View File

@ -33,7 +33,7 @@
{% endfor %}
</table>
<label for="id_voteinvalid">{% trans "Invalid" %}:</label>
<label for="id_votesinvalid">{% trans "Invalid" %}:</label>
{{ form.invalid.errors }}{{ form.invalid }}
{% if perms.poll.can_manage_poll %}

View File

@ -199,7 +199,7 @@ def poll_view(request, poll_id, ballotnumber=1):
if request.method == 'POST':
form = PollInvalidForm(request.POST, prefix="poll")
if form.is_valid():
poll.voteinvalid = form.cleaned_data['invalid'] or 0
poll.votesinvalid = form.cleaned_data['invalid'] or 0
poll.save()
success = 0
@ -214,7 +214,7 @@ def poll_view(request, poll_id, ballotnumber=1):
if success == options.count():
messages.success(request, _("Votes are successfully saved.") )
else:
form = PollInvalidForm(initial={'invalid': poll.voteinvalid}, prefix="poll")
form = PollInvalidForm(initial={'invalid': poll.votesinvalid}, prefix="poll")
for option in options:
option.form = OptionResultForm(initial={
'yes': option.voteyes,

View File

@ -26,7 +26,7 @@ class Poll(models.Model):
assignment = models.ForeignKey(Assignment, null=True, blank=True, verbose_name = _("Election"))
description = models.TextField(null=True, blank=True, verbose_name = _("Description"))
votescast = models.IntegerField(null=True, blank=True, verbose_name = _("Votes cast"))
voteinvalid = models.IntegerField(null=True, blank=True, verbose_name = _("Votes invalid"))
votesinvalid = models.IntegerField(null=True, blank=True, verbose_name = _("Votes invalid"))
def add_option(self, option):
self.save()