mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-24 06:18:08 -05:00
Don't show NSFW links in the related tab unless the Link is marked NSFW
This commit is contained in:
committed by
Neil Williams
parent
45d86810d8
commit
af0dbe5b66
@@ -670,7 +670,8 @@ class FrontController(RedditController):
|
||||
rel_range = timedelta(days=3)
|
||||
start = (article._date - rel_range).strftime("%s")
|
||||
end = (article._date + rel_range).strftime("%s")
|
||||
query = "(and %s timestamp:%s..%s)" % (query, start, end)
|
||||
nsfw = "nsfw:0" if not (article.over_18 or article._nsfw.findall(article.title)) else ""
|
||||
query = "(and %s timestamp:%s..%s %s)" % (query, start, end, nsfw)
|
||||
q = SearchQuery(query, raw_sort="-text_relevance",
|
||||
syntax="cloudsearch")
|
||||
pane = self._search(q, num=num, after=after, reverse=reverse,
|
||||
|
||||
Reference in New Issue
Block a user