[contrib.auth.admin] We need to use the AUTH_USER_MODEL defined in the settings form admin form
|Reported by:||anonymous||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
As you can see here : https://github.com/django/django/blob/master/django/contrib/auth/forms.py#L89
We are using django.contrib.auth.models.User so it doesn't work when we register our Django custom User model with UserAdmin.
We should load the User from the settings.AUTH_USER_MODEL.
How to reproduce ?
Register your custom user with UserAdmin and try to add a user from the admin.
You will get an error because of this: https://github.com/django/django/blob/master/django/contrib/auth/forms.py#L97
Change History (2)
comment:1 Changed 2 years ago by remy.hubscher@…
- Component changed from Uncategorized to contrib.auth
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Type changed from Uncategorized to Bug