From 15e4a5cdae0c3c0cb9771abaa3fd6ea086a65d3f Mon Sep 17 00:00:00 2001 From: Logan Hanks Date: Fri, 28 Oct 2011 11:15:22 -0700 Subject: [PATCH] Apply flair prefs to cache keys, even for UnloggedUser. This is necessary because comment rendering makes a pass using UnloggedUser, but needs to preserve the actual signed-in user's preferences. --- r2/r2/lib/wrapped.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r2/r2/lib/wrapped.pyx b/r2/r2/lib/wrapped.pyx index 01c6aab46..91da50a30 100644 --- a/r2/r2/lib/wrapped.pyx +++ b/r2/r2/lib/wrapped.pyx @@ -461,7 +461,7 @@ class CachedTemplate(Templated): template_hash, g.markdown_backend] # if viewing a single subreddit, take flair settings into account. - if c.user_is_loggedin and hasattr(c.site, '_id'): + if c.user and hasattr(c.site, '_id'): keys.extend([ c.site.flair_enabled, c.site.flair_position, c.user.flair_enabled_in_sr(c.site._id),