changeset 1964:0ae95dd0969e

temporary hack to add itemtype meta when unserializing files that don't have it
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 10 Feb 2013 17:17:17 +0100
parents f05af7eb6f50
children 7fe3283f9eeb
files MoinMoin/storage/middleware/serialization.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/storage/middleware/serialization.py	Sun Feb 10 07:42:39 2013 +0800
+++ b/MoinMoin/storage/middleware/serialization.py	Sun Feb 10 17:17:17 2013 +0100
@@ -61,6 +61,9 @@
         meta_str = src.read(meta_size)
         text = meta_str.decode('utf-8')
         meta = json.loads(text)
+        if 'itemtype' not in meta:
+            # temporary hack to upgrade serialized item files:
+            meta['itemtype'] = u'default'
         data_size = meta[u'size']
         curr_pos = src.tell()
         limited = LimitedStream(src, data_size)