This commit is contained in:
Aevann1 2021-09-28 21:39:51 +02:00
parent 04c3543da2
commit 99062be8d3
8 changed files with 15 additions and 44 deletions

View file

@ -85,7 +85,8 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None):
)
if not (v and v.shadowbanned) and not (v and v.admin_level == 6):
comments = comments.join(Comment.author).filter(User.shadowbanned == False)
shadowbanned = [x[0] for x in g.db.query(User.id).options(lazyload('*')).filter(User.shadowbanned == True).all()]
comments = g.db.query(Comment).options(lazyload('*')).filter(Comment.author_id.notin_(shadowbanned))
if v.admin_level >=4:
comments=comments.options(joinedload(Comment.oauth_app))