Commit ef26e8ba by Don Mitchell

Just write the loc name as the key in the policy file

parent 47621b56
......@@ -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)
......
......@@ -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])
......
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