Do metadata name translation in the mongo modulestore (because it isn't using from_json)

This commit is contained in:
Calen Pennington
2013-03-12 16:06:40 -04:00
parent dc2dbb3412
commit 7aa97d2999

View File

@@ -152,10 +152,15 @@ class CachingDescriptorSystem(MakoDescriptorSystem):
self.default_class
)
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]
kvs = MongoKeyValueStore(
definition.get('data', {}),
definition.get('children', []),
json_data.get('metadata', {}),
metadata,
)
model_data = DbModel(kvs, class_, None, MongoUsage(self.course_id, location))