Skip to content

Commit b48db4f

Browse files
committed
fix 500 error when requesting gatekeep for a user that doesn't exist
1 parent 888b082 commit b48db4f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

conditional/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,12 @@ def gatekeep(username):
164164
token = request.headers.get("X-VOTE-TOKEN", "")
165165
if token != app.config["VOTE_TOKEN"]:
166166
return "Users cannot access this page", 403
167+
try:
168+
gatekeep_data = gatekeep_status(username)
169+
except KeyError:
170+
return "", 404
167171

168-
return gatekeep_status(username), 200
172+
return gatekeep_data, 200
169173

170174

171175
@app.errorhandler(404)

0 commit comments

Comments
 (0)