automatic_reddits: only force to front page

Previously, automatic_reddits had two effects: they were added to the
list of default subscriptions, and also always forced to the front page
as long as the user hadn't unsubscribed. This change makes it so that
they are no longer added to the list of defaults, so that we can force
/r/modnews to the front page for mods without also effectively
subscribing every user to it by default.
This commit is contained in:
Chad Birch
2015-03-26 14:10:15 -06:00
parent 908203811b
commit fa2f128c3f

View File

@@ -905,16 +905,10 @@ class Subreddit(Thing, Printable, BaseSite):
@classmethod
def default_subreddits(cls, ids=True):
"""Return the subreddits a user with no subscriptions would see."""
if g.automatic_reddits:
auto_srs = cls._by_name(g.automatic_reddits, stale=True).values()
else:
auto_srs = set()
location = get_request_location()
srids = LocalizedDefaultSubreddits.get_defaults(location)
srs = Subreddit._byID(srids, data=True, return_dict=False, stale=True)
srs = list(set(srs) | set(auto_srs))
srs = filter(lambda sr: sr.allow_top, srs)
if ids: