fix: address release-retired-learner-email PR review feedback - #463
Open
rahulkanneri-2u wants to merge 2 commits into
Open
fix: address release-retired-learner-email PR review feedback#463rahulkanneri-2u wants to merge 2 commits into
rahulkanneri-2u wants to merge 2 commits into
Conversation
naincy128
approved these changes
Sep 9, 2026
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
Follow-up to #460 addressing the review comments that were
still open when that PR merged into
release-ulmo. No new behavior is introducedrelease_retired_learner_email()itself is unchanged. This is cleanup of the surrounding code and tests, plus one CLI interface change:
--usernamefrom therelease_retired_user_emailmanagement command. Per review feedback, atool built for retired learners shouldn't accept a username (PII-shaped input) at all
--user_idis now theonly supported identifier. This is a breaking change for anyone already scripting the old
--usernameflag.lint-amnestytag on theUserimport inaccounts/utils.pyand in the management command —it's slated for removal from openedx altogether, so it shouldn't be copied into new files.
settings.RETIRED_EMAIL_DOMAINinstead of a hardcodedretired.invalid, matchingthe assertions in the same tests and removing the inconsistency flagged in review.
capsys) tomocking the logger (
mock_logger.info.assert_called_with(...)), matching the existing pattern incommon/djangoapps/student/management/tests/test_change_enrollment.py.Supporting information
Testing instructions
COMPLETEstate.is_email_retired("learner@example.com")=>True../manage.py lms release_retired_user_email --user_id <retired_user_id>is_email_retired("learner@example.com")=>False; confirm re-registration succeeds.--username <retired_username>form now fails with an "unrecognized arguments" error.pytest openedx/core/djangoapps/user_api/accounts/tests/test_utils.py openedx/core/djangoapps/user_api/management/tests/test_release_retired_user_email.pyDeadline
None.
Other information
release-ulmo.release_retired_user_email --username <...>mustswitch to
--user_id <...>.