fix: skip header row in retire_user CSV - #38977
Open
rahulkanneri-2u wants to merge 1 commit into
Open
Conversation
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
Updates the
retire_usermanagement command to skip a CSV header row when the first two columns areusername,emailorusername,user_email.This fixes a Stage
retire_users_from_csvfailure where the command treated the header row as a real user and failed with:Could not find users with specified username and email address: [{'username': 'email'}]Impact: Operators running the retirement management command with a CSV file can now use a CSV that includes a standard header row. No learner-facing UI impact.
Supporting information
Private Jira: BOMS-717
Testing instructions
Create a CSV with a header row and one valid user:
Run:
Confirm the command skips the header row and processes the real user.
Automated coverage added:
retire_user --user_filewith ausername,emailheader row.Local verification:
python -m py_compileon the touched command and test files.kombuduringconftest.pyimport.Deadline
None
Other information
This does not include the
edx-internalcleanup that will eventually re-enable notifications. That can happen after this fix is deployed to Stage and theretire_users_from_csvjob is confirmed passing.No migrations, UI changes, or accessibility concerns.