|
@@ -158,10 +158,10 @@ def public_view(ballot_id):
|
|
|
if question_id == 'security_code':
|
|
|
continue
|
|
|
question = Question.query.get(question_id)
|
|
|
- for option in question.options:
|
|
|
- if option.votes.filter(Vote.user_id == user_id).first():
|
|
|
- flash('Je hebt al gestemd.', 'warning')
|
|
|
- return redirect(url_for('vote.public', ballot_id=ballot.id))
|
|
|
+ if question.has_voten(user_id):
|
|
|
+ flash('Je hebt al gestemd.', 'warning')
|
|
|
+ return redirect(url_for('vote.view', ballot_id=ballot.id))
|
|
|
+
|
|
|
option = question.options.filter(Option.id == option_id).first()
|
|
|
|
|
|
vote = Vote()
|