From eef026be1eb8b272a36aae5e266a8aea4e18e7b5 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 3 Jul 2022 12:20:43 +0200 Subject: [PATCH] don't query comments we won't use --- files/routes/posts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index ddb54778c..8ba851b7b 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -158,7 +158,7 @@ def post_id(pid, anything=None, v=None, sub=None): if not (v and v.shadowbanned) and not (v and v.admin_level >= 2): comments = comments.join(Comment.author).filter(User.shadowbanned == None) - comments=comments.filter(Comment.parent_submission == post.id).join( + comments=comments.filter(Comment.parent_submission == post.id, Comment.level < 9).join( votes, votes.c.comment_id == Comment.id, isouter=True