mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-26 15:28:37 -05:00
Refactor subreddit about.json to enable separate api_docs.
This commit is contained in:
@@ -51,6 +51,7 @@ def make_map(global_conf={}, app_conf={}):
|
||||
|
||||
mc('/about/message/:where', controller='message', action='listing')
|
||||
mc('/about/log', controller='front', action='moderationlog')
|
||||
mc('/about', controller='front', action='about')
|
||||
mc('/about/:location', controller='front',
|
||||
action='editreddit', location = 'about')
|
||||
|
||||
|
||||
@@ -571,8 +571,8 @@ class FrontController(RedditController):
|
||||
pane = FlairPane(num, after, reverse, name, user)
|
||||
elif c.user_is_sponsor and location == 'ads':
|
||||
pane = RedditAds()
|
||||
elif (not location or location == "about") and is_api():
|
||||
return Reddit(content = Wrapped(c.site)).render()
|
||||
elif (location == "about") and is_api():
|
||||
return self.redirect(add_sr('about.json'), code=301)
|
||||
else:
|
||||
return self.abort404()
|
||||
|
||||
@@ -606,6 +606,13 @@ class FrontController(RedditController):
|
||||
return self._edit_normal_reddit(location, num, after, reverse,
|
||||
count, created, name, user)
|
||||
|
||||
def GET_about(self):
|
||||
"""Return information about the subreddit.
|
||||
|
||||
Data includes the subscriber count, description, and header image."""
|
||||
if not is_api() or isinstance(c.site, FakeSubreddit):
|
||||
return self.abort404()
|
||||
return Reddit(content = Wrapped(c.site)).render()
|
||||
|
||||
def GET_awards(self):
|
||||
"""The awards page."""
|
||||
|
||||
Reference in New Issue
Block a user