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