From f9c49fc49ca50a64d283876ef1dc8989804143d3 Mon Sep 17 00:00:00 2001 From: Aevann Date: Wed, 1 Mar 2023 02:01:26 +0200 Subject: [PATCH] fix 500 error --- files/routes/polls.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/files/routes/polls.py b/files/routes/polls.py index 2faaae84e..1f7570d43 100644 --- a/files/routes/polls.py +++ b/files/routes/polls.py @@ -66,7 +66,10 @@ def option_votes(option_id, v): abort(404) option = g.db.get(SubmissionOption, option_id) if not option: abort(404) - if option.post.ghost: abort(403) + + if option.post.ghost and v.admin_level < PERMS['SEE_GHOST_VOTES']: + abort(403) + ups = g.db.query(SubmissionOptionVote).filter_by(option_id=option_id).order_by(SubmissionOptionVote.created_utc).all() user_ids = [x[0] for x in g.db.query(SubmissionOptionVote.user_id).filter_by(option_id=option_id).all()] @@ -138,7 +141,8 @@ def option_votes_comment(option_id, v): if not option: abort(404) - if option.comment.ghost: abort(403) + if option.comment.ghost and v.admin_level < PERMS['SEE_GHOST_VOTES']: + abort(403) ups = g.db.query(CommentOptionVote).filter_by(option_id=option_id).order_by(CommentOptionVote.created_utc).all()