From 000aa43c43efb02366a6679b16864cb789f28df9 Mon Sep 17 00:00:00 2001 From: Ian Weller Date: Tue, 22 Dec 2009 23:14:37 -0600 Subject: [PATCH] Handle revs that don't have content --- src/mw/metadir.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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() -- 2.39.5