forked from MarseyWorld/MarseyWorld
Extend 'hole' search operator to comments.
parent
3d2e7e415a
commit
532b248847
|
@ -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':
|
||||||
|
|
Loading…
Reference in New Issue