fix: usage_locations always returning empty (#33830)

This commit is contained in:
Kristin Aoki
2023-11-28 16:35:45 -05:00
committed by GitHub
parent 7ff1506d32
commit 9085bc140e

View File

@@ -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'],