Fixed typo (candidation -> candidature)

This commit is contained in:
Emanuel Schuetze 2012-11-24 17:39:28 +01:00
parent e0ce1052c0
commit ec60207cfd

View File

@ -85,16 +85,16 @@ class Assignment(models.Model, SlideMixin):
raise NameError(_('<b>%s</b> 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_candidates.filter(person=candidate)
if candidation and candidate != person and \
candidature = self.assignment_candidates.filter(person=candidate)
if candidature and candidate != person and \
not person.has_perm("assignment.can_manage_assignment"):
# if the candidation is blocked and anotherone tries to run the
# if the candidature is blocked and anotherone tries to run the
# candidate
raise NameError(
_('%s does not want to be a candidate.') % candidate)
elif candidation:
candidation[0].blocked = False
candidation[0].save()
elif candidature:
candidature[0].blocked = False
candidature[0].save()
else:
AssignmentCandidate(assignment=self, person=candidate).save()
@ -103,18 +103,18 @@ class Assignment(models.Model, SlideMixin):
stop running for a vote
"""
try:
candidation = self.assignment_candidates.get(person=candidate)
candidature = self.assignment_candidates.get(person=candidate)
except AssignmentCandidate.DoesNotExist:
raise Exception(_('%s is no candidate') % candidate)
if not candidation.blocked:
if not candidature.blocked:
if blocked:
candidation.blocked = True
candidation.save()
candidature.blocked = True
candidature.save()
else:
candidation.delete()
candidature.delete()
else:
candidation.delete()
candidature.delete()
def is_candidate(self, person):
@ -129,7 +129,7 @@ class Assignment(models.Model, SlideMixin):
def is_blocked(self, person):
"""
return True, if the person is blockt for candidation.
return True, if the person is blockt for candidature.
"""
return self.assignment_candidates.filter(person=person) \
.filter(blocked=True).exists()