From 077353c1f444333bf6ea03e21c7024cccafc13ce Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 12 Jul 2022 21:42:23 +0200 Subject: [PATCH] hide ghost posts from post notifications --- files/classes/user.py | 3 ++- files/routes/notifications.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/files/classes/user.py b/files/classes/user.py index 04d1c63ae..d95a2d89e 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -481,7 +481,8 @@ class User(Base): Submission.deleted_utc == 0, Submission.is_banned == False, Submission.private == False, - Submission.author_id != self.id + Submission.author_id != self.id, + Submission.ghost == False ).count() @property diff --git a/files/routes/notifications.py b/files/routes/notifications.py index 601f7a0d4..2ea025305 100644 --- a/files/routes/notifications.py +++ b/files/routes/notifications.py @@ -102,6 +102,7 @@ def notifications_posts(v): Submission.is_banned == False, Submission.private == False, Submission.author_id != v.id, + Submission.ghost == False ).order_by(Submission.created_utc.desc()).offset(25 * (page - 1)).limit(26).all()] next_exists = (len(listing) > 25)