fix: require course run for late custom enrollments#184
Open
zwidekalanga wants to merge 4 commits into
Open
Conversation
4 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #184 +/- ##
=======================================
Coverage 86.13% 86.13%
=======================================
Files 151 151
Lines 12547 12554 +7
Branches 1197 1198 +1
=======================================
+ Hits 10807 10814 +7
Misses 1425 1425
Partials 315 315 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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:
Late enrollment was still depending on course-level metadata resolving to an advertised or future run. That blocks custom/one-off presentations where the intended run is already past and no future cohort exists.
This PR makes the assignment path fail early with an actionable error when a course key does not resolve to a concrete course run, and updates operator-facing guidance to use exact course run keys for custom late enrollments. It also keeps the forced-redemption assignment path covered so the requested run remains the assignment's preferred run.
What changed
course_run_keybefore creating/updating assignments.docs/late-enrollment-custom-presentations-plan.md.Related PRs
Testing
pytest enterprise_access/apps/content_assignments/tests/test_api.py::TestAssignmentAllocationAndCancellation::test_allocate_assignments_requires_resolved_course_run enterprise_access/apps/subsidy_access_policy/tests/test_forced_redemption.py::ForcedPolicyRedemptionAssignmentTests::test_force_redemption_with_assignment_happy_pathpython -m py_compile enterprise_access/apps/content_assignments/api.py enterprise_access/apps/api/serializers/subsidy_access_policy.py enterprise_access/apps/content_assignments/tests/test_api.py enterprise_access/apps/subsidy_access_policy/tests/test_forced_redemption.pygit diff --checkJira:
ENT-XXXX
Merge checklist:
./manage.py makemigrationswas not required; no model fields were changed.Post merge: