Skip to content

feat: add exec ed course uuid to learner home serializer - #428

Open
jono-booth wants to merge 1 commit into
release-ulmofrom
jb/exec-ed-course-uuid
Open

feat: add exec ed course uuid to learner home serializer#428
jono-booth wants to merge 1 commit into
release-ulmofrom
jb/exec-ed-course-uuid

Conversation

@jono-booth

@jono-booth jono-booth commented Aug 14, 2026

Copy link
Copy Markdown

Description

Adds a courseUuid field to the Learner Home CourseRunSerializer, populated only for Executive Education (GetSmarter/Titan) enrollments — modes executive-education, paid-executive-education, unpaid-executive-education. For every other enrollment it's null and 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.

courseUuid reuses the existing get_course_uuid_for_course() catalog utility (already used by common.djangoapps.entitlements) to resolve the course's discovery Course.uuid, which is expected to match Titan's Spree::Product.course_uuid (to be confirmed with the GetSmarter/Titan team before it's relied upon downstream).

  • Which edX user roles will this change impact? Learner — Executive Education learners only. No behavior change for any other course.

Supporting information

  • Jira: ENT-9254 — EdX-ExecEd Dashboard redirect to OLC without stopping in Titan

Planned follow-ups (not in this PR):

  1. frontend-app-learner-dashboard: extend useCardExecEdTrackingParam to append courseUuid as a course_id query param on the "Start/Resume Course" link, alongside the existing org_id.
  2. titan: read that param in Spree::UsersControllerDecorator#show and redirect straight to partner_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

  1. Enroll a test user in a course with an Executive Education mode (executive-education, paid-executive-education, or unpaid-executive-education).
  2. Hit the Learner Home API (/api/learner_home/init or equivalent) and confirm the corresponding courseRun entry has a non-null courseUuid.
  3. Confirm a normal (audit/verified/etc.) enrollment's courseRun.courseUuid is null.

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 — asserts None + no catalog call for non-ExecEd, and the resolved UUID for ExecEd)

Deadline

None.

Other information

  • Depends on nothing merged elsewhere; the frontend and Titan follow-ups depend on this.
  • No database migration.
  • No new external calls for the common case — the catalog lookup only fires for Executive Education enrollments.

Copilot AI lite review requested due to automatic review settings August 14, 2026 08:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 courseUuid serializer method field, populated only for Executive Education enrollment modes.
  • Introduced an EXECUTIVE_EDUCATION_MODES allowlist 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants