mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
Ensure accurate community stats
This commit is contained in:
parent
0d3b184238
commit
de8a67f27b
1 changed files with 1 additions and 0 deletions
|
@ -206,6 +206,7 @@ def register(app):
|
||||||
|
|
||||||
# Ensure accurate community stats
|
# Ensure accurate community stats
|
||||||
for community in Community.query.filter(Community.banned == False).all():
|
for community in Community.query.filter(Community.banned == False).all():
|
||||||
|
community.subscriptions_count = CommunityMember.query.filter(CommunityMember.community_id == community.id).count()
|
||||||
community.post_count = community.posts.filter(Post.deleted == False).count()
|
community.post_count = community.posts.filter(Post.deleted == False).count()
|
||||||
community.post_reply_count = community.replies.filter(PostReply.deleted == False).count()
|
community.post_reply_count = community.replies.filter(PostReply.deleted == False).count()
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
Loading…
Reference in a new issue