Quarantine: Add discoverable property.

This commit is contained in:
Matt Lee
2015-07-23 15:25:12 -07:00
committed by Florence Yeun
parent ae1296cf87
commit 06a53b2cf5
2 changed files with 6 additions and 2 deletions

View File

@@ -263,7 +263,7 @@ def is_visible(sr):
return (
sr.type not in Subreddit.private_types and
not sr._spam and
not sr.quarantine
sr.discoverable
)

View File

@@ -601,6 +601,10 @@ class Subreddit(Thing, Printable, BaseSite):
def allow_ads(self):
return not (self.hide_ads or self.quarantine)
@property
def discoverable(self):
return self.allow_top and not self.quarantine
@related_subreddits.setter
def related_subreddits(self, related_subreddits):
try:
@@ -1016,7 +1020,7 @@ class Subreddit(Thing, Printable, BaseSite):
promo_sr_id = cls.get_promote_srid()
for sr in srs:
if sr.quarantine:
if not sr.discoverable:
continue
if sr._id == promo_sr_id: