From 65a98cd9fcd079da5fe9dd05eade940a96dec552 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 8 Jul 2022 21:14:04 +0200 Subject: [PATCH] dont show notifications for posts the user himself makes in a hole they follow --- 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 4d33d0b38..398aa51c0 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -490,7 +490,8 @@ class User(Base): Submission.created_utc > self.last_viewed_post_notifs, Submission.deleted_utc == 0, Submission.is_banned == False, - Submission.private == False + Submission.private == False, + Submission.author_id != self.id ).count() @property diff --git a/files/routes/notifications.py b/files/routes/notifications.py index 4241fad1c..797bf550f 100644 --- a/files/routes/notifications.py +++ b/files/routes/notifications.py @@ -94,7 +94,8 @@ def notifications_posts(v): ), Submission.deleted_utc == 0, Submission.is_banned == False, - Submission.private == False + Submission.private == False, + Submission.author_id != v.id, ).order_by(Submission.created_utc.desc()).offset(25 * (page - 1)).limit(26).all()] next_exists = (len(listing) > 25)