wiki: If no edit_date, do not attempt to convert it.

This commit is contained in:
Andre D
2012-10-01 07:54:42 -05:00
committed by Neil Williams
parent b64f29b235
commit 55dc8831b3

View File

@@ -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,