From fb0aed8e2bec94ae293156532f9509b4fe1343db Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 11 Aug 2023 15:43:58 +0300 Subject: [PATCH] do this https://rdrama.net/h/countryclub/post/79285/-/4758207#context --- files/classes/user.py | 3 ++- files/routes/notifications.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index e090abb2a..63f2ed094 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -769,7 +769,8 @@ class User(Base): Post.notify == True, Post.author_id != self.id, Post.ghost == False, - Post.author_id.notin_(self.userblocks) + Post.author_id.notin_(self.userblocks), + or_(Post.sub == None, Post.sub.notin_(self.sub_blocks)), ).count() @property diff --git a/files/routes/notifications.py b/files/routes/notifications.py index 5532533ce..bdfd11c59 100644 --- a/files/routes/notifications.py +++ b/files/routes/notifications.py @@ -174,7 +174,8 @@ def notifications_posts(v): Post.notify == True, Post.author_id != v.id, Post.ghost == False, - Post.author_id.notin_(v.userblocks) + Post.author_id.notin_(v.userblocks), + or_(Post.sub == None, Post.sub.notin_(v.sub_blocks)), ).options(load_only(Post.id)) total = listing.count()