This commit is contained in:
Aevann1 2021-09-16 12:04:24 +02:00
parent f7ea19bb61
commit 1223c41b4b

View file

@ -112,9 +112,6 @@ def post_id(pid, anything=None, v=None):
blocked.c.id, 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: if v.admin_level >=4:
comments=comments.options(joinedload(Comment.oauth_app)) comments=comments.options(joinedload(Comment.oauth_app))
@ -162,11 +159,9 @@ def post_id(pid, anything=None, v=None):
post.preloaded_comments = output post.preloaded_comments = output
else: else:
comments = g.db.query( shadowbanned = g.db.query(User.id).filter(User.shadowbanned == True).subquery()
Comment
).filter( comments = g.db.query(Comment).filter(Comment.parent_submission == post.id, Comment.author_id.notin_(shadowbanned))
Comment.parent_submission == post.id
)
if sort == "top": if sort == "top":
comments = sorted(comments.all(), key=lambda x: x.score, reverse=True) comments = sorted(comments.all(), key=lambda x: x.score, reverse=True)