From 21127345ec7b1503bfb863179a047fa844c7148f Mon Sep 17 00:00:00 2001 From: spez Date: Wed, 19 Nov 2008 18:53:11 -0800 Subject: [PATCH] dont show use custom styles on reddits with cnames --- r2/r2/controllers/reddit_base.py | 11 +++++++++++ r2/r2/templates/reddit.html | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/r2/r2/controllers/reddit_base.py b/r2/r2/controllers/reddit_base.py index d11261e3e..1c3fed972 100644 --- a/r2/r2/controllers/reddit_base.py +++ b/r2/r2/controllers/reddit_base.py @@ -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()) diff --git a/r2/r2/templates/reddit.html b/r2/r2/templates/reddit.html index 1025f0607..570be013a 100644 --- a/r2/r2/templates/reddit.html +++ b/r2/r2/templates/reddit.html @@ -52,7 +52,7 @@ %else: - %if (not g.css_killswitch) and c.user.pref_show_stylesheets: + %if c.allow_styles: %if c.site.stylesheet: