master
Aevann1 2021-09-16 11:57:47 +02:00
parent 0db5cc0ada
commit ab310cec2d
1 changed files with 3 additions and 5 deletions

View File

@ -111,13 +111,11 @@ def post_id(pid, anything=None, v=None):
blocking.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 not (v and v.shadowbanned) and not (v and v.admin_level == 6):
comments = comments.join(Comment.author).filter(User.shadowbanned == False)
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))