fix: usage_locations always returning empty (#33830)
This commit is contained in:
@@ -435,11 +435,15 @@ def _get_assets_in_json_format(assets, course_key, assets_usage_locations_map):
|
||||
for asset in assets:
|
||||
asset_key = asset['asset_key']
|
||||
asset_key_string = str(asset_key)
|
||||
usage_locations = getattr(assets_usage_locations_map, 'asset_key_string', [])
|
||||
thumbnail_asset_key = _get_thumbnail_asset_key(asset, course_key)
|
||||
asset_is_locked = asset.get('locked', False)
|
||||
asset_file_size = asset.get('length', None)
|
||||
|
||||
try:
|
||||
usage_locations = assets_usage_locations_map[asset_key_string]
|
||||
except KeyError:
|
||||
usage_locations = []
|
||||
|
||||
asset_in_json = get_asset_json(
|
||||
asset['displayname'],
|
||||
asset['contentType'],
|
||||
|
||||
Reference in New Issue
Block a user