Just write the loc name as the key in the policy file
This commit is contained in:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user