fix the stats page (#630)

This commit is contained in:
justcool393 2023-07-20 18:19:22 -07:00 committed by GitHub
parent c8964b272e
commit a2aa7353fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -78,13 +78,13 @@ def participation_stats(v):
"signups last 24h": users.filter(User.created_utc > day).count(),
"total posts": submissions.count(),
"posting users": g.db.query(Submission.author_id).distinct().count(),
"listed posts": submissions.filter_by(Submission.state_mod == StateMod.VISIBLE).filter(Submission.state_user_deleted_utc == None).count(),
"removed posts (by admins)": submissions.filter_by(Submission.state_mod != StateMod.VISIBLE).count(),
"listed posts": submissions.filter(Submission.state_mod == StateMod.VISIBLE).filter(Submission.state_user_deleted_utc == None).count(),
"removed posts (by admins)": submissions.filter(Submission.state_mod != StateMod.VISIBLE).count(),
"deleted posts (by author)": submissions.filter(Submission.state_user_deleted_utc != None).count(),
"posts last 24h": submissions.filter(Submission.created_utc > day).count(),
"total comments": comments.filter(Comment.author_id.notin_((AUTOJANNY_ID,NOTIFICATIONS_ID))).count(),
"commenting users": g.db.query(Comment.author_id).distinct().count(),
"removed comments (by admins)": comments.filter_by(Comment.state_mod != StateMod.VISIBLE).count(),
"removed comments (by admins)": comments.filter(Comment.state_mod != StateMod.VISIBLE).count(),
"deleted comments (by author)": comments.filter(Comment.state_user_deleted_utc != None).count(),
"comments last_24h": comments.filter(Comment.created_utc > day, Comment.author_id.notin_((AUTOJANNY_ID,NOTIFICATIONS_ID))).count(),
"post votes": g.db.query(Vote.submission_id).count(),