From f06d3da4bbac310ac6895b75fc512cd2cb9a2af2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=86=D0=B2=D0=B0=D0=BD=20=D0=9D=D1=94=D0=B4=D1=94=D0=BB?= =?UTF-8?q?=D1=8C=D0=BD=D1=96=D1=86=D0=B5=D0=B2?= Date: Thu, 21 Nov 2024 13:30:20 +0200 Subject: [PATCH] fix: provide a file URL by using url method --- lms/djangoapps/mobile_api/course_info/views.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lms/djangoapps/mobile_api/course_info/views.py b/lms/djangoapps/mobile_api/course_info/views.py index b046fb81d907..cce2d661f3cf 100644 --- a/lms/djangoapps/mobile_api/course_info/views.py +++ b/lms/djangoapps/mobile_api/course_info/views.py @@ -425,10 +425,9 @@ def _extend_block_info_with_offline_data(blocks_info_data: Dict[str, Dict]) -> N """ for block_id, block_info in blocks_info_data.items(): if offline_content_path := get_offline_block_content_path(usage_key=UsageKey.from_string(block_id)): - file_url = os.path.join(settings.MEDIA_URL, offline_content_path) block_info.update({ 'offline_download': { - 'file_url': file_url, + 'file_url': default_storage.url(offline_content_path), 'last_modified': default_storage.get_modified_time(offline_content_path), 'file_size': default_storage.size(offline_content_path) }