From de8a67f27b37061ee0696d282f6fc0b384b31ace Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Tue, 24 Dec 2024 16:59:54 +1300 Subject: [PATCH] Ensure accurate community stats --- app/cli.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app/cli.py b/app/cli.py index 8b2a3d18..392a8be0 100644 --- a/app/cli.py +++ b/app/cli.py @@ -206,6 +206,7 @@ def register(app): # Ensure accurate community stats 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_reply_count = community.replies.filter(PostReply.deleted == False).count() db.session.commit()