This commit is contained in:
2025-08-01 05:17:01 +03:00
parent 8c363a6615
commit 21d65e134f
4 changed files with 22 additions and 23 deletions

View File

@@ -358,13 +358,13 @@ class CommunityStats:
@property
def shouts(self) -> int:
return self.community.session.query(func.count(Shout.id)).where(Shout.community == self.community.id).scalar()
return self.community.session.query(func.count(Shout.id)).filter(Shout.community == self.community.id).scalar()
@property
def followers(self) -> int:
return (
self.community.session.query(func.count(CommunityFollower.follower))
.where(CommunityFollower.community == self.community.id)
.filter(CommunityFollower.community == self.community.id)
.scalar()
)
@@ -374,7 +374,7 @@ class CommunityStats:
return (
self.community.session.query(func.count(distinct(Author.id)))
.join(Shout)
.where(
.filter(
Shout.community == self.community.id,
Shout.featured_at.is_not(None),
Author.id.in_(Shout.authors),