exclude_banned_modqueue: apply to unmoderated as well

This commit is contained in:
Chad Birch
2013-07-29 21:58:39 -06:00
parent 639dab92d4
commit 19395afbd7
3 changed files with 6 additions and 2 deletions

View File

@@ -568,6 +568,9 @@ class FrontController(RedditController, OAuth2ResourceController):
return True # spam, unless banned by a moderator
return False
elif location == "unmoderated":
# banned user, don't show if subreddit pref excludes
if x.author._spam and x.subreddit.exclude_banned_modqueue:
return False
return not getattr(x, 'verdict', None)
else:
raise ValueError

View File

@@ -840,7 +840,8 @@ def new_link(link):
with CachedQueryMutator() as m:
if link._spam:
m.insert(get_spam_links(sr), [link])
m.insert(get_unmoderated_links(sr), [link])
if not (sr.exclude_banned_modqueue and author._spam):
m.insert(get_unmoderated_links(sr), [link])
add_queries(results, insert_items = link)
amqp.add_item('new_link', link._fullname)

View File

@@ -261,7 +261,7 @@
%endif
>
<label for="exclude_banned_modqueue">
${_("exclude posts by site-wide banned users from modqueue")}
${_("exclude posts by site-wide banned users from modqueue/unmoderated")}
</label>
</li>
<li>