From 55dc8831b30fa1ca8ec0cc0c4f5d5d5d5a2cb6c4 Mon Sep 17 00:00:00 2001 From: Andre D Date: Mon, 1 Oct 2012 07:54:42 -0500 Subject: [PATCH] wiki: If no edit_date, do not attempt to convert it. --- r2/r2/lib/jsontemplates.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/r2/r2/lib/jsontemplates.py b/r2/r2/lib/jsontemplates.py index e215f2e27..e4e4caba7 100755 --- a/r2/r2/lib/jsontemplates.py +++ b/r2/r2/lib/jsontemplates.py @@ -588,7 +588,7 @@ class WikiJsonTemplate(JsonTemplate): class WikiViewJsonTemplate(ThingJsonTemplate): def render(self, thing, *a, **kw): - edit_date = time.mktime(thing.edit_date.timetuple()) + edit_date = time.mktime(thing.edit_date.timetuple()) if thing.edit_date else None return ObjectTemplate(dict(content_md=thing.page_content_md, content_html=wikimarkdown(thing.page_content_md), revision_by=thing.edit_by, @@ -597,7 +597,7 @@ class WikiViewJsonTemplate(ThingJsonTemplate): class WikiRevisionJsonTemplate(ThingJsonTemplate): def render(self, thing, *a, **kw): - timestamp = time.mktime(thing.date.timetuple()) + timestamp = time.mktime(thing.date.timetuple()) if thing.date else None return ObjectTemplate(dict(author=thing._get('author'), id=str(thing._id), timestamp=timestamp,