From ef26e8baa3a8096c69edf0d0486085069e248781 Mon Sep 17 00:00:00 2001 From: Don Mitchell Date: Wed, 25 Sep 2013 10:06:05 -0400 Subject: [PATCH] Just write the loc name as the key in the policy file --- common/lib/xmodule/xmodule/contentstore/mongo.py | 2 +- common/lib/xmodule/xmodule/modulestore/xml_importer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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])