Skip to content

Commit

Permalink
feat: make assets url tenant aware
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-canon committed Dec 3, 2024
1 parent f73c54d commit f6d3a9d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cms/djangoapps/contentstore/asset_storage_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f6d3a9d

Please sign in to comment.