diff --git a/lms/djangoapps/commerce/signals.py b/lms/djangoapps/commerce/signals.py index 85dbf3e1e4..f08c5facbe 100644 --- a/lms/djangoapps/commerce/signals.py +++ b/lms/djangoapps/commerce/signals.py @@ -16,6 +16,7 @@ from microsite_configuration import microsite from request_cache.middleware import RequestCache from student.models import UNENROLL_DONE from openedx.core.djangoapps.commerce.utils import ecommerce_api_client, is_commerce_service_configured +from openedx.core.djangoapps.theming.helpers import get_value log = logging.getLogger(__name__) @@ -196,7 +197,8 @@ def generate_refund_notification_body(student, refund_ids): # pylint: disable=i "To process this request, please visit the link(s) below." ).format(username=student.username, email=student.email) - refund_urls = [urljoin(settings.ECOMMERCE_PUBLIC_URL_ROOT, '/dashboard/refunds/{}/'.format(refund_id)) + ecommerce_url_root = get_value('ECOMMERCE_PUBLIC_URL_ROOT', settings.ECOMMERCE_PUBLIC_URL_ROOT) + refund_urls = [urljoin(ecommerce_url_root, '/dashboard/refunds/{}/'.format(refund_id)) for refund_id in refund_ids] return '{msg}\n\n{urls}'.format(msg=msg, urls='\n'.join(refund_urls)) diff --git a/lms/djangoapps/commerce/utils.py b/lms/djangoapps/commerce/utils.py index 7499c57053..a4e775c395 100644 --- a/lms/djangoapps/commerce/utils.py +++ b/lms/djangoapps/commerce/utils.py @@ -55,7 +55,8 @@ class EcommerceService(object): Example: http://localhost:8002/basket/single_item/ """ - return urljoin(settings.ECOMMERCE_PUBLIC_URL_ROOT, self.config.single_course_checkout_page) + ecommerce_url_root = helpers.get_value('ECOMMERCE_PUBLIC_URL_ROOT', settings.ECOMMERCE_PUBLIC_URL_ROOT) + return urljoin(ecommerce_url_root, self.config.single_course_checkout_page) def checkout_page_url(self, sku): """ Construct the URL to the ecommerce checkout page and include a product. diff --git a/lms/templates/dashboard/_dashboard_credit_info.html b/lms/templates/dashboard/_dashboard_credit_info.html index d10f4e531e..230124c553 100644 --- a/lms/templates/dashboard/_dashboard_credit_info.html +++ b/lms/templates/dashboard/_dashboard_credit_info.html @@ -21,8 +21,9 @@ credit_msg_class = "credit-eligibility-msg" credit_btn_class = "purchase-credit-btn" credit_btn_label = _("Get Credit") + ecommerce_url_root = static.get_value('ECOMMERCE_PUBLIC_URL_ROOT', settings.ECOMMERCE_PUBLIC_URL_ROOT) credit_btn_href = '{root}/credit/checkout/{course_id}/'.format( - root=settings.ECOMMERCE_PUBLIC_URL_ROOT, + root=ecommerce_url_root, course_id=credit_status['course_key']) if credit_status["purchased"]: