Commit 9c5b0ba6 by Calen Pennington

Create the data dir to put files in, if it doesn't exist when loading a module from mongo

parent eb20e471
......@@ -153,7 +153,12 @@ class MongoModuleStore(ModuleStoreBase):
Load an XModuleDescriptor from item, using the children stored in data_cache
"""
data_dir = item.get('metadata', {}).get('data_dir', item['location']['course'])
resource_fs = OSFS(self.fs_root / data_dir)
root = self.fs_root / data_dir
if not root.isdir():
root.mkdir()
resource_fs = OSFS(root)
system = CachingDescriptorSystem(
self,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment