Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

wiki: Fix deleted account leak.

  • Loading branch information...
commit 7850a4b25a6280975a20b9fd5cfee39aabef2b8f 1 parent d20ec78
@andre-d andre-d authored spladug committed
Showing with 7 additions and 2 deletions.
  1. +7 −2 r2/r2/lib/jsontemplates.py
View
9 r2/r2/lib/jsontemplates.py
@@ -600,7 +600,9 @@ def kind(self, thing):
def data(self, thing):
edit_date = time.mktime(thing.edit_date.timetuple()) if thing.edit_date else None
- edit_by = Wrapped(thing.edit_by).render() if thing.edit_by else None
+ edit_by = None
+ if thing.edit_by and not thing.edit_by._deleted:
+ edit_by = Wrapped(thing.edit_by).render()
return dict(content_md=thing.page_content_md,
content_html=wikimarkdown(thing.page_content_md),
revision_by=edit_by,
@@ -620,7 +622,10 @@ class WikiRevisionJsonTemplate(ThingJsonTemplate):
def render(self, thing, *a, **kw):
timestamp = time.mktime(thing.date.timetuple()) if thing.date else None
author = thing.get_author()
- author = Wrapped(author).render() if author else None
+ if author and not author._deleted:
+ author = Wrapped(author).render()
+ else:
+ author = None
return ObjectTemplate(dict(author=author,
id=str(thing._id),
timestamp=timestamp,
Please sign in to comment.
Something went wrong with that request. Please try again.