diff --git a/files/routes/search.py b/files/routes/search.py index b9d062193e..231f2e589d 100644 --- a/files/routes/search.py +++ b/files/routes/search.py @@ -179,7 +179,8 @@ def searchcomments(v): criteria = searchparse(query) - comments = g.db.query(Comment.id).filter(Comment.parent_submission != None, Comment.author_id.notin_(v.userblocks)) + comments = g.db.query(Comment.id).join(Comment.post) \ + .filter(Comment.parent_submission != None, Comment.author_id.notin_(v.userblocks)) if 'author' in criteria: comments = comments.filter(Comment.ghost == False) @@ -201,6 +202,9 @@ def searchcomments(v): if 'over18' in criteria: comments = comments.filter(Comment.over_18 == True) + if 'hole' in criteria: + comments = comments.filter(Submission.sub == criteria['hole']) + if t: now = int(time.time()) if t == 'hour':