Skip to content
This repository was archived by the owner on Dec 8, 2022. It is now read-only.

Commit 6027b43

Browse files
authored
Merge branch 'master' into net8floz-patch-7
2 parents 47c81aa + 2ddefa1 commit 6027b43

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

CodeChallenge/api/vote.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,10 @@ def vote_confirm():
182182
reason="token is not valid"), 400
183183

184184
v = Vote.query.get(vote_id)
185+
if not v:
186+
return jsonify(status="error",
187+
reason="vote not found - try voting again, or contestant may have been disqualified.")
188+
185189
delete_votes = Vote.query \
186190
.filter(Vote.voter_email == v.voter_email,
187191
Vote.id != v.id) \

0 commit comments

Comments
 (0)