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