Skip to content

Commit

Permalink
Fix Exception Checking (#87)
Browse files Browse the repository at this point in the history
* Fix selectivity for exception requests,
so that folks don't get a false "you've already requested".

Signed-off-by: Josh Berkus <[email protected]>

---------

Signed-off-by: Josh Berkus <[email protected]>
  • Loading branch information
jberkus authored Apr 28, 2023
1 parent a9e0c64 commit 6533cb3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions elekto/controllers/elections.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,16 +233,16 @@ def elections_exception(eid):
req = (
SESSION.query(Request)
.join(Request, Election.requests)
.filter(Request.user_id == F.g.user.id)
.filter(Request.user_id == F.g.user.id, Election.key == eid)
.first()
)

if req:
return F.render_template(
"errors/message.html",
title="You have already filled the form.",
message="please wait for the election's\
supervisor to view your request.",
title="You have already requested an exception.",
message="You have already requested an exception for this election;\
Please wait for the admin to review your request.",
)

if F.request.method == "POST":
Expand Down

0 comments on commit 6533cb3

Please sign in to comment.