Commit 2c767840 authored by Sli's avatar Sli
Browse files

Fixed Election.has_voted

parent 89362bae
......@@ -37,7 +37,10 @@ class Election(models.Model):
return bool(now <= self.end_candidature and now >= self.start_candidature)
def has_voted(self, user):
return hasattr(user, 'has_voted') and list(user.has_voted.all()) == list(self.role.all())
for role in self.role.all():
if role.user_has_voted(user):
return True
return False
def can_candidate(self, user):
for group in self.candidature_groups.all():
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment