From fea0ce115fe8a1ece0964b457c827adb398fa976 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 6 Oct 2022 08:41:48 +0200 Subject: [PATCH] do the result of this poll https://rdrama.org/post/79285/-/2845495?context=8#context --- files/classes/user.py | 5 +---- files/routes/users.py | 6 ++---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index 12aed3b0f..c30ed2be9 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -458,10 +458,7 @@ class User(Base): posts = g.db.query(Submission.id).filter_by(author_id=self.id, is_pinned=False) if not (v and (v.admin_level > 1 or v.id == self.id)): - posts = posts.filter_by(is_banned=False, private=False, ghost=False) - - if not (v and v.admin_level > 1): - posts = posts.filter_by(deleted_utc=0) + posts = posts.filter_by(is_banned=False, private=False, ghost=False, deleted_utc=0) posts = apply_time_filter(t, posts, Submission) diff --git a/files/routes/users.py b/files/routes/users.py index 54aa674ab..79d604e9c 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -1145,12 +1145,10 @@ def u_username_comments(username, v=None): comments = comments.filter( Comment.is_banned == False, Comment.ghost == False, - comment_post_author.shadowbanned == None + comment_post_author.shadowbanned == None, + Comment.deleted_utc == 0 ) - if not (v and v.admin_level > 1): - comments = comments.filter(Comment.deleted_utc == 0) - comments = apply_time_filter(t, comments, Comment) comments = sort_comments(sort, comments)