Extend 'hole' search operator to comments.

master
Snakes 2022-06-23 02:11:03 -04:00
parent 3d2e7e415a
commit 532b248847
1 changed files with 5 additions and 1 deletions

View File

@ -179,7 +179,8 @@ def searchcomments(v):
criteria = searchparse(query) 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: if 'author' in criteria:
comments = comments.filter(Comment.ghost == False) 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 'over18' in criteria: comments = comments.filter(Comment.over_18 == True)
if 'hole' in criteria:
comments = comments.filter(Submission.sub == criteria['hole'])
if t: if t:
now = int(time.time()) now = int(time.time())
if t == 'hour': if t == 'hour':