Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Override BaseUserAdmin add_fieldsets #3829

Merged
merged 1 commit into from
Nov 7, 2024
Merged

Bug: Override BaseUserAdmin add_fieldsets #3829

merged 1 commit into from
Nov 7, 2024

Conversation

ana-cullen
Copy link
Contributor

Closes #3826 .

Website crashed when trying to 'Add user' via the admin panel with FieldError. This was caused by updating to Django 5.1 where a new field 'usable_password' was added to BaseUserAdmin that our UserAdmin class inherited.

Fix was overriding the add_fieldsets attribute so that it didn't include 'usable_password' but did include the fields we want when we add a new user

How to test

  1. Go to Admin on website
  2. Click on 'Users' -> Add button
  3. It should no longer crash and you should be able to save a new user with Username, First Name, Last Name, Password, Email

@ana-cullen ana-cullen added the bug Something that should be fixed label Nov 6, 2024
Copy link
Contributor

@T8902 T8902 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@T8902 T8902 merged commit 1884992 into master Nov 7, 2024
9 checks passed
@T8902 T8902 deleted the 3826-fielderror branch November 7, 2024 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that should be fixed
Projects
None yet
2 participants