Fix error when reporting things not in a subreddit

This commit is contained in:
Chad Birch
2013-04-08 16:56:49 -06:00
parent b619e64cdc
commit af88ac3719

View File

@@ -1081,9 +1081,10 @@ class ApiController(RedditController, OAuth2ResourceController):
elif isinstance(thing, Comment):
pass
sr = getattr(thing, 'subreddit_slow', None)
if (c.user._spam or
c.user.ignorereports or
thing.subreddit_slow.is_banned(c.user)):
(sr and sr.is_banned(c.user))):
return
Report.new(c.user, thing)
admintools.report(thing)