Skip to content

Commit

Permalink
Apply flair prefs to cache keys, even for UnloggedUser.
Browse files Browse the repository at this point in the history
This is necessary because comment rendering makes a pass using
UnloggedUser, but needs to preserve the actual signed-in user's
preferences.
  • Loading branch information
Logan Hanks committed Oct 28, 2011
1 parent c911b30 commit 15e4a5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion r2/r2/lib/wrapped.pyx
Expand Up @@ -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),
Expand Down

0 comments on commit 15e4a5c

Please sign in to comment.