Look up data_dir in the metadata, not in the top of the json object when loading from mongodb

This commit is contained in:
Calen Pennington
2012-07-27 15:24:24 -04:00
parent 2caf1024f1
commit 395cf147be

View File

@@ -141,8 +141,9 @@ class MongoModuleStore(ModuleStore):
"""
Load an XModuleDescriptor from item, using the children stored in data_cache
"""
resource_fs = OSFS(self.fs_root / item.get('data_dir',
item['location']['course']))
data_dir = item.get('metadata', {}).get('data_dir', item['location']['course'])
resource_fs = OSFS(self.fs_root / data_dir)
system = CachingDescriptorSystem(
self,
data_cache,