From 4ba17111bf2f96ebed7b812ae5e791687cdbc80d Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 22 Oct 2021 02:31:08 +0200 Subject: [PATCH] fd --- files/routes/posts.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index a298b130b..6c2ae36da 100755 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -157,8 +157,7 @@ def post_id(pid, anything=None, v=None): comment.is_blocked = c[3] or 0 output.append(comment) - post.replies = output - + post.replies = [x for x in output if x.level == 1] else: shadowbanned = [x[0] for x in g.db.query(User.id).options(lazyload('*')).filter(User.shadowbanned != None).all()] comments = g.db.query(Comment).filter(Comment.parent_submission == post.id, Comment.author_id != AUTOPOLLER_ACCOUNT, Comment.author_id.notin_(shadowbanned)) @@ -174,7 +173,7 @@ def post_id(pid, anything=None, v=None): elif sort == "bottom": comments = comments.order_by(Comment.upvotes - Comment.downvotes) - post.replies = comments.all() + post.replies = comments.filter_by(level=1).all() post.views += 1 g.db.add(post)