dont show use custom styles on reddits with cnames

This commit is contained in:
spez
2008-11-19 18:53:11 -08:00
parent 5b1fcbed78
commit 21127345ec
2 changed files with 12 additions and 1 deletions

View File

@@ -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())

View File

@@ -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" />