diff --git a/common/lib/xmodule/xmodule/contentstore/mongo.py b/common/lib/xmodule/xmodule/contentstore/mongo.py index 2c717e51c6..1e788c0a47 100644 --- a/common/lib/xmodule/xmodule/contentstore/mongo.py +++ b/common/lib/xmodule/xmodule/contentstore/mongo.py @@ -122,7 +122,7 @@ class MongoContentStore(ContentStore): self.export(asset_location, output_directory) for attr, value in asset.iteritems(): if attr not in ['_id', 'md5', 'uploadDate', 'length', 'chunkSize']: - policy.setdefault(asset_location.url(), {})[attr] = value + policy.setdefault(asset_location.name, {})[attr] = value with open(assets_policy_file, 'w') as f: json.dump(policy, f) diff --git a/common/lib/xmodule/xmodule/modulestore/xml_importer.py b/common/lib/xmodule/xmodule/modulestore/xml_importer.py index 64caad0481..1494e5fecb 100644 --- a/common/lib/xmodule/xmodule/modulestore/xml_importer.py +++ b/common/lib/xmodule/xmodule/modulestore/xml_importer.py @@ -56,7 +56,7 @@ def import_static_content(modules, course_loc, course_data_path, static_content_ content_loc = StaticContent.compute_location(target_location_namespace.org, target_location_namespace.course, fullname_with_subpath) - policy_ele = policy.get(content_loc.url(), {}) + policy_ele = policy.get(content_loc.name, {}) displayname = policy_ele.get('displayname', filename) locked = policy_ele.get('locked', False) mime_type = policy_ele.get('contentType', mimetypes.guess_type(filename)[0])