From 6533cb3156921b5a02d3853b86d5cd9d4920c48d Mon Sep 17 00:00:00 2001 From: Josh Berkus Date: Fri, 28 Apr 2023 15:28:24 -0700 Subject: [PATCH] Fix Exception Checking (#87) * Fix selectivity for exception requests, so that folks don't get a false "you've already requested". Signed-off-by: Josh Berkus --------- Signed-off-by: Josh Berkus --- elekto/controllers/elections.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/elekto/controllers/elections.py b/elekto/controllers/elections.py index 41ee921..dcfd69a 100644 --- a/elekto/controllers/elections.py +++ b/elekto/controllers/elections.py @@ -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":