Merged
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Restructure the CustomUser admin to use django-unfold tabbed layout with Profile, Permissions, and Activity tabs per S2.13.5-04. Add is_superuser and requested_department to list filters (S2.13.5-06), requested_department autocomplete (S2.13.5-08), and department column to list display (S2.13.5-05). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… link Register custom Group admin with UnfoldAdmin base class per S2.13.5-09. Annotate queryset with user count and display in list view. Add link to filtered user changelist from each group row. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implement assign/remove groups, set/clear is_staff, set/clear is_superuser, and assign department bulk actions on CustomUserAdmin per S2.13.5-10. Superuser actions restricted to superusers with confirmation step (S2.13.5-11). All actions create LogEntry audit records (S2.13.5-12). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Member
Author
|
I think this PR misses the mark on the department management compared to the intent of the issue (and the spec). It's implemented for the "requested department" which is used during user creation/activation, but not actually the department (which is a m2m key from the Department model). Working on a fix for this now. |
The assign_department action was incorrectly setting the requested_department FK instead of managing the Department.managers M2M relationship. This fixes the MUST requirement S2.13.5-02 and adds a remove_from_department action. - display_department now shows managed_departments (M2M) not requested_department - assign_department adds users to Department.managers M2M - Added remove_from_department bulk action with intermediate form - Department list filter changed to managed_departments - 3 new tests, all 1384 passing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Verification found that only 4 of 8 bulk actions had explicit LogEntry audit tests. Adds tests for remove_groups, clear_is_staff, clear_is_superuser, and assign_department to close the V15 gap. All 8 bulk actions now have LogEntry audit coverage per S2.13.5-12. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Implements #4
Summary
Test Coverage
TestCustomUserAdminLayout(24 tests): admin layout, list columns, filters, search, autocompleteTestGroupAdminLayout(8 tests): UnfoldAdmin base, user count annotation, filtered user linkTestBulkUserActions(16 tests): each action's data modification, superuser-only restrictions, LogEntry audit recordsCreated by spec-pipeline