From b96d6a1ccb1c14816c6d90d060a7f1691ffa1baf Mon Sep 17 00:00:00 2001 From: justcool393 Date: Sat, 8 Oct 2022 23:42:32 -0700 Subject: [PATCH] =?UTF-8?q?scope=20variables=20properly=20=F0=9F=A4=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/routes/users.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/files/routes/users.py b/files/routes/users.py index 37d7ab6403..ba7bd703e5 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -177,6 +177,8 @@ def all_upvoters_downvoters(v, username, vote_dir, is_who_simps_hates): id = get_user(username, v=v, include_shadowbanned=False).id if not (v.id == id or v.admin_level >= PERMS['USER_VOTERS_VISIBLE']): abort(403) + votes = [] + votes2 = [] if is_who_simps_hates: votes = g.db.query(Submission.author_id, func.count(Submission.author_id)).join(Vote).filter(Submission.ghost == False, Submission.is_banned == False, Submission.deleted_utc == 0, Vote.vote_type==vote_dir, Vote.user_id==id).group_by(Submission.author_id).order_by(func.count(Submission.author_id).desc()).all() votes2 = g.db.query(Comment.author_id, func.count(Comment.author_id)).join(CommentVote).filter(Comment.ghost == False, Comment.is_banned == False, Comment.deleted_utc == 0, CommentVote.vote_type==vote_dir, CommentVote.user_id==id).group_by(Comment.author_id).order_by(func.count(Comment.author_id).desc()).all()