From fe6fe68e3c60e4c89cf23fe40d53ac0da8b769d9 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 20 Dec 2022 23:30:31 +0200 Subject: [PATCH] fix this https://stupidpol.site/post/18459/marseycapywalking-megathread-for-bugs-and-suggestions/3276699 --- files/routes/votes.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/files/routes/votes.py b/files/routes/votes.py index 4641860369..0ed986ebb3 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -20,7 +20,11 @@ def vote_info_get(v, link): if (thing.author.shadowbanned and not (v and v.admin_level >= PERMS['USER_SHADOWBAN'])): thing_id = g.db.query(Submission.id) \ - .filter_by(upvotes=thing.upvotes, downvotes=thing.downvotes) \ + .filter( + Submission.upvotes == thing.upvotes, + Submission.downvotes == thing.downvotes, + Submission.created_utc >= thing.created_utc, + ) \ .order_by(Submission.id).first()[0] else: thing_id = thing.id @@ -38,7 +42,11 @@ def vote_info_get(v, link): if (thing.author.shadowbanned and not (v and v.admin_level >= PERMS['USER_SHADOWBAN'])): thing_id = g.db.query(Comment.id) \ - .filter_by(upvotes=thing.upvotes, downvotes=thing.downvotes) \ + .filter( + Comment.upvotes == thing.upvotes, + Comment.downvotes == thing.downvotes, + Comment.created_utc >= thing.created_utc, + ) \ .order_by(Comment.id).first()[0] else: thing_id = thing.id