From f6d3a9d799d5d0aba0bb038287fb5774f47e2206 Mon Sep 17 00:00:00 2001 From: andrey-canon Date: Tue, 3 Dec 2024 14:57:42 -0500 Subject: [PATCH] feat: make assets url tenant aware --- cms/djangoapps/contentstore/asset_storage_handlers.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cms/djangoapps/contentstore/asset_storage_handlers.py b/cms/djangoapps/contentstore/asset_storage_handlers.py index 281258e03a8d..4858c0e45f67 100644 --- a/cms/djangoapps/contentstore/asset_storage_handlers.py +++ b/cms/djangoapps/contentstore/asset_storage_handlers.py @@ -714,7 +714,12 @@ def get_asset_json(display_name, content_type, date, location, thumbnail_locatio Helper method for formatting the asset information to send to client. ''' asset_url = StaticContent.serialize_asset_key_with_slash(location) - external_url = urljoin(configuration_helpers.get_value('LMS_ROOT_URL', settings.LMS_ROOT_URL), asset_url) + lms_root = configuration_helpers.get_value_for_org( + location.org, + 'LMS_ROOT_URL', + settings.LMS_ROOT_URL + ) + external_url = urljoin(lms_root, asset_url) portable_url = StaticContent.get_static_path_from_location(location) usage_locations = [] if usage is None else usage return {