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.
This commit is contained in:
Logan Hanks
2011-10-28 11:15:22 -07:00
parent c911b30479
commit 15e4a5cdae

View File

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