Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add course_run_key to learner home upgrade url #35461

Merged
merged 2 commits into from
Sep 20, 2024
Merged
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
10 changes: 8 additions & 2 deletions lms/djangoapps/learner_home/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

from datetime import date, timedelta
from urllib.parse import urljoin
from urllib.parse import urlencode, urljoin

from django.conf import settings
from django.urls import reverse
Expand Down Expand Up @@ -132,7 +132,13 @@ def get_upgradeUrl(self, instance):
)

if ecommerce_payment_page and verified_sku:
return f"{ecommerce_payment_page}?sku={verified_sku}"
query_params = {
'sku': verified_sku,
'course_run_key': str(instance.course_id)
}
encoded_params = urlencode(query_params)
upgrade_url = f"{ecommerce_payment_page}?{encoded_params}"
return upgrade_url

def get_resumeUrl(self, instance):
return self.context.get("resume_course_urls", {}).get(instance.course_id)
Expand Down
Loading