From bf078e2f1aa96c852e0654598599f15e156b7a63 Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 8 Jun 2023 02:07:47 +0300 Subject: [PATCH] fix this https://rdrama.net/post/18459/marseycapywalking-megathread-for-bugs-and-suggestions/4222635#context --- files/routes/search.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/files/routes/search.py b/files/routes/search.py index c6073a82d..004a6c431 100644 --- a/files/routes/search.py +++ b/files/routes/search.py @@ -156,6 +156,9 @@ def searchposts(v:User): posts = apply_time_filter(t, posts, Submission) + if not v.can_see_shadowbanned: + posts = posts.join(Submission.author).filter(User.shadowbanned == None) + total = posts.count() posts = sort_objects(sort, posts, Submission) @@ -264,6 +267,9 @@ def searchcomments(v:User): except: abort(400) comments = comments.filter(Comment.created_utc < before) + if not v.can_see_shadowbanned: + comments = comments.join(Comment.author).filter(User.shadowbanned == None) + total = comments.count() comments = sort_objects(sort, comments, Comment) @@ -353,6 +359,9 @@ def searchmessages(v:User): comments = comments.filter(Comment.sentto == sentto.id) + if not v.can_see_shadowbanned: + comments = comments.join(Comment.author).filter(User.shadowbanned == None) + total = comments.count() comments = sort_objects(sort, comments, Comment)