fix: Redact uid field and delete records for retired users from support_historicalusersocialauth#38658
Merged
Merged
Conversation
…rt_historicalusersocialauth
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR strengthens user retirement by ensuring PII stored in django-simple-history snapshots of social auth records is redacted and removed during the retirement workflow.
Changes:
- Call a new retirement utility to redact+delete
HistoricalUserSocialAuthrows during user retirement. - Add
redact_and_delete_historical_social_authutility that updatesuid/extra_datathen deletes historical rows. - Add LMS tests covering UPDATE-before-DELETE behavior and deletion scope.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| openedx/core/djangoapps/user_api/accounts/views.py | Invokes the new historical social auth redaction/deletion step during retirement. |
| openedx/core/djangoapps/user_api/accounts/utils.py | Adds a utility to redact+delete historical social auth snapshots that can retain PII. |
| openedx/core/djangoapps/user_api/accounts/tests/test_utils.py | Adds tests validating query ordering and deletion behavior for historical social auth redaction. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
robrap
reviewed
May 29, 2026
robrap
left a comment
Contributor
There was a problem hiding this comment.
Thanks. Updates requested.
f39ed15 to
96dffa9
Compare
ttak-apphelix
approved these changes
Jun 2, 2026
robrap
reviewed
Jun 2, 2026
robrap
left a comment
Contributor
There was a problem hiding this comment.
Nice. It's close. Thank you.
…s.py Co-authored-by: Robert Raposa <rraposa@gmail.com>
16972f1 to
a6324df
Compare
vgulati-apphelix
approved these changes
Jun 3, 2026
robrap
approved these changes
Jun 3, 2026
robrap
left a comment
Contributor
There was a problem hiding this comment.
Approved, but let me know if you update before we meet.
robrap
reviewed
Jun 4, 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:
Ensures PII in django-simple-history snapshots of social auth records is redacted before deletion during user retirement.
Changes:
redact_and_delete_historical_social_authutility that bulk-redactsuidand clearsextra_databefore bulk-deleting rows.LMSAccountRetirementView.post()in the retirement workflow.test_utils.py,test_retire_user.py, andtest_retirement_views.pyusing the sharedassert_redact_before_deletehelper.Private JIRA Link:
BOMS-577