fix garbage query

master
Aevann 2024-04-08 03:53:54 +02:00
parent d708cbf9bf
commit 16dfd5aaed
1 changed files with 1 additions and 3 deletions

View File

@ -240,13 +240,11 @@ def searchcomments(v):
comments = apply_time_filter(t, comments, Comment)
if v.admin_level < PERMS['POST_COMMENT_MODERATION']:
private = [x[0] for x in g.db.query(Post.id).filter(Post.draft == True)]
comments = comments.filter(
Comment.is_banned==False,
Comment.deleted_utc == 0,
or_(
Comment.parent_post.notin_(private),
Post.draft == False,
Comment.wall_user_id != None
)
)