Skip to content

Loading…

Show over18 page when visiting a nsfw multireddit #435

Closed
wants to merge 1 commit into from

2 participants

@andre-d

Fixes #430

@spladug
reddit member

I don't think this needs to be a property, does it? You can just set over_18 directly to True or False.

@andre-d andre-d closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 1, 2012
  1. @andre-d
Showing with 8 additions and 2 deletions.
  1. +8 −2 r2/r2/models/subreddit.py
View
10 r2/r2/models/subreddit.py
@@ -892,16 +892,22 @@ def sponsorship_img(self):
class MultiReddit(_DefaultSR):
name = 'multi'
header = ""
-
+
+ @property
+ def over_18(self):
+ return self._over_18
+
def __init__(self, sr_ids, path):
_DefaultSR.__init__(self)
self.real_path = path
self.sr_ids = sr_ids
-
+ self._over_18 = False
self.srs = Subreddit._byID(self.sr_ids, return_dict=False)
self.banned_sr_ids = []
self.kept_sr_ids = []
for sr in self.srs:
+ if sr.over_18:
+ self._over_18 = True
if sr._spam:
self.banned_sr_ids.append(sr._id)
else:
Something went wrong with that request. Please try again.