Skip to content

Commit

Permalink
fix: usage_locations always returning empty (#33830)
Browse files Browse the repository at this point in the history
  • Loading branch information
KristinAoki authored Nov 28, 2023
1 parent 7ff1506 commit 9085bc1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cms/djangoapps/contentstore/asset_storage_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down

0 comments on commit 9085bc1

Please sign in to comment.