diff --git a/cms/djangoapps/contentstore/asset_storage_handlers.py b/cms/djangoapps/contentstore/asset_storage_handlers.py index 1e4dbd61240b..3f77a934f946 100644 --- a/cms/djangoapps/contentstore/asset_storage_handlers.py +++ b/cms/djangoapps/contentstore/asset_storage_handlers.py @@ -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'],