From 2bc2dad7a5e36c14ed52e57bfeee8470390f03d4 Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Fri, 3 Aug 2012 19:15:14 +0200 Subject: [PATCH] user-api: small fix for the second poll in assignment --- openslides/assignment/models.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openslides/assignment/models.py b/openslides/assignment/models.py index bc48dcd31..6f7fbf169 100644 --- a/openslides/assignment/models.py +++ b/openslides/assignment/models.py @@ -131,7 +131,7 @@ class Assignment(models.Model, SlideMixin): def set_elected(self, user, value=True): - candidate = AssignmentCandidate.objects.get(user=user) + candidate = self.assignment_candidats.get(user=user) candidate.elected = value candidate.save() @@ -255,8 +255,7 @@ class AssignmentPoll(BasePoll, CountInvalid, CountVotesCast, PublishPollMixin): self.yesnoabstain = True else: # candidates <= available posts -> yes/no/abstain - if self.assignment.assignment_candidats.filter(elected=False).count() <= (self.assignment.posts - - self.assignment.assignment_candidats.filter(elected=True).count()): + if self.assignment.assignment_candidats.filter(elected=False).count() <= (self.assignment.posts): self.yesnoabstain = True else: self.yesnoabstain = False