Skip to content

Commit

Permalink
Disallow voting in closed polls
Browse files Browse the repository at this point in the history
  • Loading branch information
rmorell committed May 22, 2012
1 parent c53ed78 commit 5782599
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions models.py
Expand Up @@ -40,6 +40,8 @@ def vote_for_member(self,member=None):
return self.votes.filter('member =',member).get()

def register_vote(self,choice,member=None):
if self.has_results:
raise Exception('Cannot vote in closed polls.')
if not member:
member = users.get_current_user()
member_vote = self.vote_for_member(member)
Expand Down

0 comments on commit 5782599

Please sign in to comment.