master
Aevann1 2021-09-16 12:04:24 +02:00
parent faaf6ee6a8
commit 80b409fb6e
1 changed files with 3 additions and 8 deletions

View File

@ -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)