From 2fdbad55f1fecf4b6164e17c4002495d7c2b7254 Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Thu, 28 Jun 2012 20:11:16 +0200 Subject: [PATCH] rename AssignmentPoll.yesnoababstain in .yesnoabstain --- openslides/assignment/models.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/openslides/assignment/models.py b/openslides/assignment/models.py index f7588f45d..0d56a6cc1 100644 --- a/openslides/assignment/models.py +++ b/openslides/assignment/models.py @@ -37,7 +37,7 @@ class Assignment(models.Model, SlideMixin): description = models.TextField(null=True, blank=True, verbose_name=_("Description")) posts = models.PositiveSmallIntegerField(verbose_name=_("Number of available posts")) polldescription = models.CharField(max_length=100, null=True, blank=True, verbose_name=_("Short description (for ballot paper)")) - profile = models.ManyToManyField(Profile, null=True, blank=True) + profile = models.ManyToManyField(Profile, null=True, blank=True) # Rename it in candidate elected = models.ManyToManyField(Profile, null=True, blank=True, related_name='elected_set') status = models.CharField(max_length=3, choices=STATUS, default='sea') @@ -185,25 +185,25 @@ class AssignmentPoll(BasePoll, CountInvalid, CountVotesCast, PublishPollMixin): option_class = AssignmentOption assignment = models.ForeignKey(Assignment, related_name='poll_set') - yesnoababstain = models.NullBooleanField() + yesnoabstain = models.NullBooleanField() def get_assignment(self): return self.assignment def get_vote_values(self): - if self.yesnoababstain is None: + if self.yesnoabstain is None: if config['assignment_poll_vote_values'] == 'votes': - self.yesnoababstain = False + self.yesnoabstain = False elif config['assignment_poll_vote_values'] == 'yesnoabstain': - self.yesnoababstain = True + self.yesnoabstain = True else: # candidates <= available posts -> yes/no/abstain if self.assignment.candidates.count() <= self.assignment.posts - self.assignment.elected.count(): - self.yesnoababstain = True + self.yesnoabstain = True else: - self.yesnoababstain = False + self.yesnoabstain = False self.save() - if self.yesnoababstain: + if self.yesnoabstain: return [_('Yes', fixstr=True), _('No', fixstr=True), _('Abstain', fixstr=True)] else: return [_('Votes', fixstr=True)]