feat: add exec ed course uuid to learner home serializer - #428
Open
jono-booth wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the Learner Home CourseRunSerializer API response to include a courseUuid value (sourced from the Catalog service) for Executive Education (GetSmarter/Titan) enrollments, enabling the frontend to construct Titan redirect URLs with the needed catalog identifier.
Changes:
- Added a
courseUuidserializer method field, populated only for Executive Education enrollment modes. - Introduced an
EXECUTIVE_EDUCATION_MODESallowlist to gate when the catalog lookup occurs. - Updated and expanded serializer tests to verify the field is populated only for Executive Education modes and that non-ExecEd modes do not query the catalog.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
lms/djangoapps/learner_home/serializers.py |
Adds courseUuid to CourseRunSerializer, conditionally fetching the catalog UUID for ExecEd modes only. |
lms/djangoapps/learner_home/test_serializers.py |
Updates tests to cover ExecEd/non-ExecEd behavior and ensures catalog lookup is avoided when not needed. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a
courseUuidfield to the Learner HomeCourseRunSerializer, populated only for Executive Education (GetSmarter/Titan) enrollments — modesexecutive-education,paid-executive-education,unpaid-executive-education. For every other enrollment it'snulland the catalog service is never queried.This is step 1 of a 3-repo change for ENT-9254 (see below). Today, a learner clicking "Start Course" on their edx.org dashboard for an enrolled ExecEd/GetSmarter presentation lands on a generic Titan/GetSmarter profile page and has to click "View Course" a second time to reach the OLC (Online Learning Campus). Titan can skip that extra hop and redirect straight into the OLC if it's given an identifier for the course — but edx-platform currently has no such identifier anywhere in the dashboard payload.
courseUuidreuses the existingget_course_uuid_for_course()catalog utility (already used bycommon.djangoapps.entitlements) to resolve the course's discoveryCourse.uuid, which is expected to match Titan'sSpree::Product.course_uuid(to be confirmed with the GetSmarter/Titan team before it's relied upon downstream).Supporting information
Planned follow-ups (not in this PR):
frontend-app-learner-dashboard: extenduseCardExecEdTrackingParamto appendcourseUuidas acourse_idquery param on the "Start/Resume Course" link, alongside the existingorg_id.titan: read that param inSpree::UsersControllerDecorator#showand redirect straight topartner_olc_link(product)instead of rendering the profile page, when it matches an allocation.This PR is safe to merge standalone — it only adds a new, additively-gated field to an existing API response; nothing consumes it yet.
Testing instructions
executive-education,paid-executive-education, orunpaid-executive-education)./api/learner_home/initor equivalent) and confirm the correspondingcourseRunentry has a non-nullcourseUuid.courseRun.courseUuidisnull.Covered by new/updated unit tests in
lms/djangoapps/learner_home/test_serializers.py:test_with_data(updated to exercise an Executive Education enrollment)test_course_uuid_only_populated_for_executive_education(new — assertsNone+ no catalog call for non-ExecEd, and the resolved UUID for ExecEd)Deadline
None.
Other information