is voter missing

This commit is contained in:
Ville Rantanen
2018-12-13 22:02:08 +02:00
parent f928449666
commit a1cf9ddc64
2 changed files with 17 additions and 0 deletions

View File

@@ -65,6 +65,8 @@ def vote(key, token = None):
if is_expired(form):
return render_template('blank.html', message = "Voting has closed")
if is_closed_vote(form):
if is_voter(key, token):
return render_template('blank.html', message = "Token invalid")
if has_voted(key, token):
return render_template('blank.html', message = "Token already used")
valid_for = time_to_expiry(form)
@@ -86,6 +88,8 @@ def save_vote():
if is_expired(form):
return render_template('blank.html', message = "Voting has closed")
if is_closed_vote(form):
if is_voter(key, token):
return render_template('blank.html', message = "Token invalid")
if has_voted(key, token):
return render_template('blank.html', message = "Token already used")