Skip to content

Commit

Permalink
fix: provide a file URL by using url method
Browse files Browse the repository at this point in the history
  • Loading branch information
NiedielnitsevIvan committed Nov 21, 2024
1 parent 5faa2fa commit f06d3da
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lms/djangoapps/mobile_api/course_info/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit f06d3da

Please sign in to comment.