Display results only when the polls close

This commit is contained in:
Jean-Baptiste Lenglet
2016-12-23 21:53:54 +01:00
committed by klmp200
parent 1c761f9db2
commit 64f5fef89f
3 changed files with 21 additions and 12 deletions

View File

@ -31,6 +31,10 @@ class Election(models.Model):
now = timezone.now()
return bool(now <= self.end_date and now >= self.start_date)
@property
def is_vote_finished(self):
return bool(timezone.now() > self.end_date)
@property
def is_candidature_active(self):
now = timezone.now()