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

This commit is contained in:
Don Mitchell
2013-09-25 10:06:05 -04:00
parent 47621b56ff
commit ef26e8baa3
2 changed files with 2 additions and 2 deletions

View File

@@ -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)

View File

@@ -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])