feat: personless User deletion via admin#9312
Merged
Merged
Conversation
rjsparks
approved these changes
Aug 6, 2025
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9312 +/- ##
=======================================
Coverage 88.74% 88.75%
=======================================
Files 320 320
Lines 41674 41689 +15
=======================================
+ Hits 36985 37001 +16
+ Misses 4689 4688 -1 ☔ 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This replaces the default

UserAdminwith one that adds an action to delete selectedUserrecords that are not associated with aPerson. A list filter is added to allow selecting / reviewing these records. Selecting all on a page will cause an option to "Select all users" to appear:Clicking this will select all records, including those that are not on the current page of 100.
Selecting the action and clicking "Go" gives the usual review of objects / related objects to be deleted. It also applies two adjustments to the selected set. First, only users whose person field is null will be affected. Any others will be ignored. Second, the set of objects that will be is limited to 990. This is needed because Django has a global limit on the number of fields a request can contain (which is at its default of 1000). Clicking on the "Yes I'm sure" will carry out the deletion.