From c82bdaa4d3cdb4845d3f9319af2d7f26c1a00d6d Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 17 Jan 2022 15:09:11 +0200 Subject: [PATCH] f --- files/routes/votes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/votes.py b/files/routes/votes.py index 5e8083aa0..63940a181 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -115,7 +115,7 @@ def api_vote_post(post_id, new, v): g.db.flush() post.upvotes = g.db.query(Vote.id).filter_by(submission_id=post.id, vote_type=1).count() post.downvotes = g.db.query(Vote.id).filter_by(submission_id=post.id, vote_type=-1).count() - post.realupvotes = g.db.query(Vote.id).filter_by(submission_id=post.id, vote_type=1, real=True).count() - g.db.query(Vote.id).filter_by(submission_id=post.id, vote_type=1, real=False).count() + g.db.query(Vote.id).filter_by(submission_id=post.id, vote_type=-1).count() + post.realupvotes = g.db.query(Vote.id).filter_by(submission_id=post.id, vote_type=1, real=True).count() + g.db.query(Vote.id).filter_by(submission_id=post.id, vote_type=-1).count() if post.author.progressivestack: post.realupvotes *= 2 g.db.add(post) g.db.commit() @@ -181,7 +181,7 @@ def api_vote_comment(comment_id, new, v): g.db.flush() comment.upvotes = g.db.query(CommentVote.id).filter_by(comment_id=comment.id, vote_type=1).count() comment.downvotes = g.db.query(CommentVote.id).filter_by(comment_id=comment.id, vote_type=-1).count() - comment.realupvotes = g.db.query(CommentVote.id).filter_by(comment_id=comment.id, vote_type=1, real=True).count() - g.db.query(CommentVote.id).filter_by(comment_id=comment.id, vote_type=1, real=False).count() + g.db.query(CommentVote.id).filter_by(comment_id=comment.id, vote_type=-1).count() + comment.realupvotes = g.db.query(CommentVote.id).filter_by(comment_id=comment.id, vote_type=1, real=True).count() + g.db.query(CommentVote.id).filter_by(comment_id=comment.id, vote_type=-1).count() if comment.author.progressivestack: comment.realupvotes *= 2 g.db.add(comment) g.db.commit()