This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

JSON: Fix deleted account names being leaked.

  • Loading branch information...
1 parent faa59a2 commit 3a5eabc7cccc7b5136c5e638a9bb4a7441e1e38f @spladug spladug committed Dec 2, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 r2/r2/lib/jsontemplates.py
@@ -156,15 +156,21 @@ def thing_attr(self, thing, attr):
things).
"""
if attr == "author":
+ if thing.author._deleted:
+ return None
return thing.author.name
if attr == "author_flair_text":
+ if thing.author._deleted:
+ return None
if thing.author.flair_enabled_in_sr(thing.subreddit._id):
return getattr(thing.author,
'flair_%s_text' % (thing.subreddit._id),
None)
else:
return None
if attr == "author_flair_css_class":
+ if thing.author._deleted:
+ return None
if thing.author.flair_enabled_in_sr(thing.subreddit._id):
return getattr(thing.author,
'flair_%s_css_class' % (thing.subreddit._id),

0 comments on commit 3a5eabc

Please sign in to comment.