From f92a83724b6b0e914037ec8cbcea15a100829712 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 26 Aug 2022 16:57:14 +0200 Subject: [PATCH] try to fix 500 error in WPD --- files/routes/votes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/votes.py b/files/routes/votes.py index 77bc3bf7e..b08338e85 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -202,7 +202,7 @@ def vote_comment(comment_id, new, v): g.db.add(vote) - g.db.flush() + g.db.commit() comment.upvotes = g.db.query(CommentVote).filter_by(comment_id=comment.id, vote_type=1).count() comment.downvotes = g.db.query(CommentVote).filter_by(comment_id=comment.id, vote_type=-1).count() comment.realupvotes = g.db.query(CommentVote).filter_by(comment_id=comment.id, real=True).count()