diff --git a/openslides/assignment/models.py b/openslides/assignment/models.py index 8c8019dda..749296470 100644 --- a/openslides/assignment/models.py +++ b/openslides/assignment/models.py @@ -85,7 +85,7 @@ class Assignment(models.Model, SlideMixin): raise NameError(_('%s is already a candidate.') % candidate) if not person.has_perm("assignment.can_manage_assignment") and self.status != 'sea': raise NameError(_('The candidate list is already closed.')) - candidation = self.assignment_candidats.filter(person=candidate) + candidation = self.assignment_candidates.filter(person=candidate) if candidation and candidate != person and \ not person.has_perm("assignment.can_manage_assignment"): # if the candidation is blocked and anotherone tries to run the @@ -103,9 +103,8 @@ class Assignment(models.Model, SlideMixin): stop running for a vote """ try: - candidation = self.assignment_candidats.get(person=candidate) + candidation = self.assignment_candidates.get(person=candidate) except AssignmentCandidate.DoesNotExist: - # TODO: Use an OpenSlides Error raise Exception(_('%s is no candidate') % candidate) if not candidation.blocked: @@ -123,7 +122,7 @@ class Assignment(models.Model, SlideMixin): return True, if person is a candidate. """ try: - return self.assignment_candidats.filter(person=person) \ + return self.assignment_candidates.filter(person=person) \ .exclude(blocked=True).exists() except AttributeError: return False @@ -132,11 +131,11 @@ class Assignment(models.Model, SlideMixin): """ return True, if the person is blockt for candidation. """ - return self.assignment_candidats.filter(person=person) \ + return self.assignment_candidates.filter(person=person) \ .filter(blocked=True).exists() @property - def assignment_candidats(self): + def assignment_candidates(self): return AssignmentCandidate.objects.filter(assignment=self) @property @@ -148,7 +147,7 @@ class Assignment(models.Model, SlideMixin): return self.get_participants(only_elected=True) def get_participants(self, only_elected=False, only_candidate=False): - candidates = self.assignment_candidats.exclude(blocked=True) + candidates = self.assignment_candidates.exclude(blocked=True) assert not (only_elected and only_candidate) @@ -166,7 +165,7 @@ class Assignment(models.Model, SlideMixin): def set_elected(self, person, value=True): - candidate = self.assignment_candidats.get(person=person) + candidate = self.assignment_candidates.get(person=person) candidate.elected = value candidate.save() diff --git a/openslides/assignment/templates/assignment/view.html b/openslides/assignment/templates/assignment/view.html index e67d485db..69063e7ff 100644 --- a/openslides/assignment/templates/assignment/view.html +++ b/openslides/assignment/templates/assignment/view.html @@ -111,7 +111,7 @@ {% endif %} -{% if assignment.status != "sea" %} +{% if assignment.status != "sea" or polls.exists %}