mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 00:07:57 -05:00
Subreddit routing: add /about/sticky redirect
Redirects to the subreddit's current sticky post
This commit is contained in:
@@ -141,6 +141,7 @@ def make_map():
|
||||
requirements=dict(controller="hot|new|rising|randomrising"))
|
||||
|
||||
mc('/about/sidebar', controller='front', action='sidebar')
|
||||
mc('/about/sticky', controller='front', action='sticky')
|
||||
mc('/about/flair', controller='front', action='flairlisting')
|
||||
mc('/about', controller='front', action='about')
|
||||
mc('/comments/gilded', controller='redirect', action='gilded_comments',
|
||||
|
||||
@@ -752,6 +752,14 @@ class FrontController(RedditController, OAuth2ResourceController):
|
||||
usertext = UserText(c.site, c.site.description)
|
||||
return Reddit(content=usertext).render()
|
||||
|
||||
@require_oauth2_scope("read")
|
||||
def GET_sticky(self):
|
||||
if c.site.sticky_fullname:
|
||||
sticky = Link._by_fullname(c.site.sticky_fullname, data=True)
|
||||
self.redirect(sticky.make_permalink_slow())
|
||||
else:
|
||||
abort(404)
|
||||
|
||||
def GET_awards(self):
|
||||
"""The awards page."""
|
||||
return BoringPage(_("awards"), content=UserAwards()).render()
|
||||
|
||||
Reference in New Issue
Block a user