Better support for random subreddit.

This commit is contained in:
Michael Lazar
2016-04-08 01:31:55 -07:00
parent fc8d70f06d
commit 8fc93911c6
3 changed files with 1364 additions and 0 deletions

View File

@@ -405,6 +405,9 @@ class SubredditContent(Content):
}
else:
subreddit = reddit.get_subreddit(name)
# For special subreddits like /r/random we want to replace the
# display name with the one returned by the request.
display_name = '/r/{0}'.format(subreddit.display_name)
dispatch = {
None: subreddit.get_hot,
'hot': subreddit.get_hot,