diff --git a/files/routes/search.py b/files/routes/search.py index 37410827c..8221232a9 100644 --- a/files/routes/search.py +++ b/files/routes/search.py @@ -236,7 +236,9 @@ def searchcomments(v): ' & '.join(tokens), postgresql_regconfig='english')) - if 'nsfw' in criteria: comments = comments.filter(Comment.nsfw == True) + if 'nsfw' in criteria: + nsfw = criteria['nsfw'].lower().strip() == 'true' + comments = comments.filter(Comment.nsfw == nsfw) if 'hole' in criteria: comments = comments.filter(Post.hole == criteria['hole'])