Permalink
Browse files

Special handling in Link.keep_fn to show spam on domain pages.

Keep spam only if the user moderates the link's subreddit.
  • Loading branch information...
1 parent d86a7fe commit 252ee3e5511192d5a500f5c958d193c7dd581904 @bsimpson63 bsimpson63 committed with spladug Oct 2, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 r2/r2/models/link.py
View
5 r2/r2/models/link.py
@@ -26,7 +26,7 @@
from r2.lib.utils import base_url, tup, domain, title_to_url, UrlParser
from r2.lib.utils.trial_utils import trial_info
from account import Account, DeletedUser
-from subreddit import Subreddit
+from subreddit import Subreddit, DomainSR
from printable import Printable
from r2.config import cache, extensions
from r2.lib.memoize import memoize
@@ -198,7 +198,8 @@ def link_domain(self):
def keep_item(self, wrapped):
user = c.user if c.user_is_loggedin else None
- if not c.user_is_admin:
+ if not (c.user_is_admin or (isinstance(c.site, DomainSR) and
+ wrapped.subreddit.is_moderator(user))):
if self._spam and (not user or
(user and self.author_id != user._id)):
return False

0 comments on commit 252ee3e

Please sign in to comment.