[BB-5195] feat: disable auto enrollment after course enrollment ends
Description
This PR seeks to address the following scenario:
- Non-registered user is enrolled in a course
- Course enrollment ends
- User registers after course enrollment has ended
- User in enrolled to the course anyways
This PR introduces a feature flag "DISABLE_ALLOWED_ENROLLMENT_IF_ENROLLMENT_CLOSED" which when set to True, the newly registered user is not automatically enrolled to the course if the enrollment has ended.
Impacted user roles : Learner
Supporting information
Testing instructions
- Set the "DISABLE_ALLOWED_ENROLLMENT_IF_ENROLLMENT_CLOSED" flag to true
- As a staff user, enroll an email-id to a course and set auto-enroll to true.
- From the studio settings, set the course enrollment end date to a past date, so that the enrollment ends.
- Register to the lms, using the email-id enrolled above.
- Check that the user is NOT enrolled to the course
Thanks for the pull request, @kaustavb12! Please note that it may take us up to several weeks or months to complete a review and merge your PR.
Feel free to add as much of the following information to the ticket as you can:
- supporting documentation
- Open edX discussion forum threads
- timeline information ("this must be merged by XX date", and why that is)
- partner information ("this is a course on edx.org")
- any other information that can help Product understand the context for the PR
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.
Please let us know once your PR is ready for our review and all tests are green.
@kaustavb12 Thank you for your contribution. Is this ready for our review?
@natabene, not yet - we're still discussing the approach internally, so I've converted this to a draft. We will ping you once it's ready for your review.
Your PR has finished running tests. There were no failures.
@kaustavb12 @Agrendalath Just checking if this is still on your radar.
@natabene, just in time. We have scheduled resuming this for our ongoing sprint :)
@natabene, this is ready for your review.
New internal ticket link: https://2u-internal.atlassian.net/browse/TNL-9987
Branch rebased and merge conflicts resolved.
Unrelated test case failing after recent changes in master.
Rebased again .. all checks are now green.
Hi @Agrendalath! Just checking on this. Are you able to merge this, or is there a reason it is still open? Is it waiting on other work?
Thanks for checking, @mphilbrick211. I rebased this (just in case) and will merge it in ~2 hours.
@kaustavb12 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production.
EdX Release Notice: This PR has been deployed to the production environment.
EdX Release Notice: This PR has been deployed to the production environment.