From 1223c41b4bd38003fb0a6c4826953176bc649c20 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 16 Sep 2021 12:04:24 +0200 Subject: [PATCH] fd --- files/routes/posts.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index 3ec431937..61bc485fc 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -112,9 +112,6 @@ def post_id(pid, anything=None, v=None): blocked.c.id, ) - # shadowbanned = g.db.query(User.id).filter(User.shadowbanned == False).subquery() - # comments = comments.filter(Comment.author_id.notin_(shadowbanned)) - if v.admin_level >=4: comments=comments.options(joinedload(Comment.oauth_app)) @@ -162,11 +159,9 @@ def post_id(pid, anything=None, v=None): post.preloaded_comments = output else: - comments = g.db.query( - Comment - ).filter( - Comment.parent_submission == post.id - ) + shadowbanned = g.db.query(User.id).filter(User.shadowbanned == True).subquery() + + comments = g.db.query(Comment).filter(Comment.parent_submission == post.id, Comment.author_id.notin_(shadowbanned)) if sort == "top": comments = sorted(comments.all(), key=lambda x: x.score, reverse=True)