From cf4ea53d015b04f1fea146a974f9d049338776e7 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Wed, 13 Mar 2013 09:34:27 -0400 Subject: [PATCH] Small fixes to mongo metadata translations --- common/lib/xmodule/xmodule/modulestore/mongo.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/modulestore/mongo.py b/common/lib/xmodule/xmodule/modulestore/mongo.py index c7361e4d68..4377c34361 100644 --- a/common/lib/xmodule/xmodule/modulestore/mongo.py +++ b/common/lib/xmodule/xmodule/modulestore/mongo.py @@ -153,9 +153,10 @@ class CachingDescriptorSystem(MakoDescriptorSystem): ) definition = json_data.get('definition', {}) metadata = json_data.get('metadata', {}) - for old_name, new_name in class_.metadata_tranlations.items(): - metadata[new_name] = metadata[old_name] - del metadata[old_name] + for old_name, new_name in class_.metadata_translations.items(): + if old_name in metadata: + metadata[new_name] = metadata[old_name] + del metadata[old_name] kvs = MongoKeyValueStore( definition.get('data', {}),