fix: Fixes the enrollment counts for audit courses in Instructor Dashboard#38679
Conversation
|
Thanks for the pull request, @brianjbuck-wgu! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the instructor API v2 enrollment-count serialization to include enrollment modes that have active enrollments even when those modes aren’t explicitly configured for the course (addressing a dashboard regression).
Changes:
- Expand
get_enrollment_countsto add mode slugs present in enrollment counts but missing from course configuration. - Update the corresponding API v2 test to assert unconfigured-but-used modes (e.g.,
audit) appear and validate totals.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lms/djangoapps/instructor/views/serializers_v2.py | Extends enrollment counts to include additional mode slugs found in actual enrollments. |
| lms/djangoapps/instructor/tests/test_api_v2.py | Revises test expectations to cover unconfigured modes that still have enrollments and validates total consistency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
76c3c2a to
6e65a47
Compare
Description
Fixes a regression in the enrollment track visibility on the Course Info page of the Instructor Dashboard MFE.
In PR #38007,
get_enrollment_counts()was refactored to only return modes explicitly configured viaCourseMode.modes_for_course(). The intent was to show configured modes with 0 enrollments (e.g., a "professional" track with no learners yet). However, this inadvertently hid learners enrolled in modes that aren't explicitly configured, most notably the default "audit" track, which learners are placed into automatically but may not be listed as a configured course mode.The result: the total count could be higher than the sum of the displayed mode counts, and entire enrollment tracks were invisible in the UI.
The fix returns the union of configured modes and modes with active enrollments, preserving both behaviors:
Impacted roles: Course Author, Operator (Instructor Dashboard MFE consumers)
Supporting information
Testing instructions
Deadline
None
Other information