Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lms/djangoapps/commerce/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
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__)

Expand Down Expand Up @@ -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))
Expand Down
3 changes: 2 additions & 1 deletion lms/djangoapps/commerce/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ def payment_page_url(self):
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.
Expand Down
3 changes: 2 additions & 1 deletion lms/templates/dashboard/_dashboard_credit_info.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,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"]:
Expand Down