]> projects.mako.cc - mw/commitdiff
Handle revs that don't have content
authorIan Weller <ian@ianweller.org>
Wed, 23 Dec 2009 05:14:37 +0000 (23:14 -0600)
committerIan Weller <ian@ianweller.org>
Wed, 23 Dec 2009 05:14:37 +0000 (23:14 -0600)
src/mw/metadir.py

index e09c840276cf45bdb9a5fe6a5f693716f8606b69..f02422330b0edd816687b354de146ec1ebd3eb78 100644 (file)
@@ -98,9 +98,10 @@ class Metadir(object):
             pagedata = json.loads(pagedata_raw)
         rvid = int(rv['revid'])
         pagedata[rvid] = {
             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()
         fd.seek(0)
         fd.write(json.dumps(pagedata))
         fd.truncate()

Benjamin Mako Hill || Want to submit a patch?