diff --git a/files/helpers/stats.py b/files/helpers/stats.py index ed91b6970..5362d2b23 100644 --- a/files/helpers/stats.py +++ b/files/helpers/stats.py @@ -122,8 +122,8 @@ def stats(site=None): "post voting users": g.db.query(Vote.user_id).distinct().count(), "comment votes": g.db.query(CommentVote).count(), "comment voting users": g.db.query(CommentVote.user_id).distinct().count(), - "total upvotes": g.db.query(Vote).filter_by(vote_type=1).count() + g.db.query(CommentVote.comment_id).filter_by(vote_type=1).count(), - "total downvotes": g.db.query(Vote).filter_by(vote_type=-1).count() + g.db.query(CommentVote.comment_id).filter_by(vote_type=-1).count(), + "total upvotes": g.db.query(Vote).filter_by(vote_type=1).count() + g.db.query(CommentVote).filter_by(vote_type=1).count(), + "total downvotes": g.db.query(Vote).filter_by(vote_type=-1).count() + g.db.query(CommentVote).filter_by(vote_type=-1).count(), "total awards": g.db.query(AwardRelationship).count(), "awards given": g.db.query(AwardRelationship).filter(or_(AwardRelationship.submission_id != None, AwardRelationship.comment_id != None)).count(), "users who posted, commented, or voted in the past 7 days": len(active_users),