diff --git a/files/helpers/get.py b/files/helpers/get.py index 8e4fa518a..abf609e09 100644 --- a/files/helpers/get.py +++ b/files/helpers/get.py @@ -187,9 +187,10 @@ def get_comment(i, v=None, graceful=False, **kwargs): ) ).first() + vt = g.db.query(CommentVote).filter_by(user_id=v.id, comment_id=Comment.id).first() comment._is_blocking = block and block.user_id == v.id comment._is_blocked = block and block.target_id == v.id - comment._voted = g.db.query(CommentVote).filter_by(user_id=v.id, comment_id=Comment.id).first().vote_type + comment._voted = vt.vote_type if vt else 0 else: comment = g.db.query(Comment).filter(Comment.id == i).first()