From: Ian Weller Date: Wed, 23 Dec 2009 05:14:37 +0000 (-0600) Subject: Handle revs that don't have content X-Git-Url: https://projects.mako.cc/source/mw/commitdiff_plain/000aa43c43efb02366a6679b16864cb789f28df9?ds=sidebyside Handle revs that don't have content --- diff --git a/src/mw/metadir.py b/src/mw/metadir.py index e09c840..f024223 100644 --- a/src/mw/metadir.py +++ b/src/mw/metadir.py @@ -98,9 +98,10 @@ class Metadir(object): pagedata = json.loads(pagedata_raw) rvid = int(rv['revid']) pagedata[rvid] = { - 'user': rv['user'], 'timestamp': rv['timestamp'], - 'content': rv['*'], + 'user': rv['user'], 'timestamp': rv['timestamp'] } + if '*' in rv.keys(): + pagedata[rvid]['content'] = rv['*'] fd.seek(0) fd.write(json.dumps(pagedata)) fd.truncate()