Semantic HTML and post feed #23

Merged
Jaculabilis merged 10 commits from tvb/post-feed into develop 2021-10-02 00:18:32 +00:00
1 changed files with 6 additions and 1 deletions
Showing only changes of commit 8754823556 - Show all commits

View File

@ -93,6 +93,11 @@ def get_unread_count(db: DbContext, membership_id: int) -> int:
return db(
select(func.count(Post.id))
.join(Membership, Membership.lexicon_id == Post.lexicon_id)
.where(or_(Membership.last_post_seen.is_(None), Post.created > Membership.last_post_seen))
.where(
or_(
Membership.last_post_seen.is_(None),
Post.created > Membership.last_post_seen,
)
)
.where(Membership.id == membership_id)
).scalar()