mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user