From b0a6ffa022bd8927dffc5d88e58980ab0fa1044e Mon Sep 17 00:00:00 2001 From: Cristhian Garcia Date: Tue, 24 Sep 2024 08:23:20 -0500 Subject: [PATCH] fix(scorm): use request host for scorm custom domain (#142) (cherry picked from commit 1a8cf5bde09482fb1237ceb78f79e6ce41feb63c) --- drydock/patches/openedx-common-settings | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drydock/patches/openedx-common-settings b/drydock/patches/openedx-common-settings index 480e11fd..3b0afc10 100644 --- a/drydock/patches/openedx-common-settings +++ b/drydock/patches/openedx-common-settings @@ -3,10 +3,16 @@ def scorm_xblock_storage(xblock): from django.conf import settings from storages.backends.s3boto3 import S3Boto3Storage - if SERVICE_VARIANT == "lms": - domain = settings.LMS_BASE - else: - domain = settings.CMS_BASE + from xmodule.util.xmodule_django import get_current_request_hostname + + domain = get_current_request_hostname() + + if not domain: + if SERVICE_VARIANT == "lms": + domain = settings.LMS_BASE + else: + domain = settings.CMS_BASE + return S3Boto3Storage( bucket=AWS_STORAGE_BUCKET_NAME, access_key=AWS_ACCESS_KEY_ID,