mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 00:07:57 -05:00
dont show use custom styles on reddits with cnames
This commit is contained in:
@@ -508,6 +508,17 @@ class RedditController(BaseController):
|
||||
and c.render_style == 'html'):
|
||||
return self.intermediate_redirect("/over18")
|
||||
|
||||
#check whether to allow custom styles
|
||||
c.allow_styles = True
|
||||
if g.css_killswitch:
|
||||
c.allow_styles = False
|
||||
#if the preference is set and we're not at a cname
|
||||
elif not c.user.pref_show_stylesheets and not c.cname:
|
||||
c.allow_styles = False
|
||||
#if the site has a cname, but we're not using it
|
||||
elif c.site.domain and not c.cname:
|
||||
c.allow_styles = False
|
||||
|
||||
#check content cache
|
||||
if not c.user_is_loggedin:
|
||||
r = cache.get(self.request_key())
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
%else:
|
||||
<link rel="stylesheet" href="${static(g.stylesheet)}"
|
||||
type="text/css" />
|
||||
%if (not g.css_killswitch) and c.user.pref_show_stylesheets:
|
||||
%if c.allow_styles:
|
||||
%if c.site.stylesheet:
|
||||
<link rel="stylesheet" href="${static(c.site.stylesheet)}"
|
||||
type="text/css" />
|
||||
|
||||
Reference in New Issue
Block a user