feat: personless User deletion via admin #9312
Merged
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

UserAdmin
with one that adds an action to delete selectedUser
records 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.