Skip to content
This repository
Browse code

JSON: Fix deleted account names being leaked.

  • Loading branch information...
commit 3a5eabc7cccc7b5136c5e638a9bb4a7441e1e38f 1 parent faa59a2
Neil Williams authored December 01, 2012

Showing 1 changed file with 6 additions and 0 deletions. Show diff stats Hide diff stats

  1. 6  r2/r2/lib/jsontemplates.py
6  r2/r2/lib/jsontemplates.py
@@ -156,8 +156,12 @@ def thing_attr(self, thing, attr):
156 156
         things).
157 157
         """
158 158
         if attr == "author":
  159
+            if thing.author._deleted:
  160
+                return None
159 161
             return thing.author.name
160 162
         if attr == "author_flair_text":
  163
+            if thing.author._deleted:
  164
+                return None
161 165
             if thing.author.flair_enabled_in_sr(thing.subreddit._id):
162 166
                 return getattr(thing.author,
163 167
                                'flair_%s_text' % (thing.subreddit._id),
@@ -165,6 +169,8 @@ def thing_attr(self, thing, attr):
165 169
             else:
166 170
                 return None
167 171
         if attr == "author_flair_css_class":
  172
+            if thing.author._deleted:
  173
+                return None
168 174
             if thing.author.flair_enabled_in_sr(thing.subreddit._id):
169 175
                 return getattr(thing.author,
170 176
                                'flair_%s_css_class' % (thing.subreddit._id),

0 notes on commit 3a5eabc

Please sign in to comment.
Something went wrong with that request. Please try again.