Move over-18 intersitial outside of subreddit context.

This way subreddit sidebars aren't visible until you confirm your age.
This commit is contained in:
Max Goodman
2013-09-20 20:34:05 -07:00
parent 3939e7c62d
commit f2614b5e6f
2 changed files with 3 additions and 3 deletions

View File

@@ -1130,7 +1130,7 @@ class RedditController(MinimalController):
if (c.site.over_18 and not c.over18 and
request.path not in ("/frame", "/over18")
and c.render_style == 'html'):
return self.intermediate_redirect("/over18")
return self.intermediate_redirect("/over18", sr_path=False)
#check whether to allow custom styles
c.allow_styles = True

View File

@@ -180,7 +180,7 @@ class BaseController(WSGIController):
@classmethod
def intermediate_redirect(cls, form_path):
def intermediate_redirect(cls, form_path, sr_path=True):
"""
Generates a /login or /over18 redirect from the current
fullpath, after having properly reformated the path via
@@ -193,7 +193,7 @@ class BaseController(WSGIController):
params['callback'] = request.GET.get("callback")
path = add_sr(cls.format_output_url(form_path) +
query_string(params))
query_string(params), sr_path=sr_path)
abort(302, location=path)
@classmethod