Opened 6 years ago

Closed 6 years ago

#20188 closed Bug (invalid)

[contrib.auth.admin] We need to use the AUTH_USER_MODEL defined in the settings form admin form

Reported by: anonymous Owned by: nobody
Component: contrib.auth Version: 1.5
Severity: Normal Keywords:
Cc: bmispelon@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


As you can see here :

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:

Change History (2)

comment:1 Changed 6 years ago by remy.hubscher@…

Component: Uncategorizedcontrib.auth
Type: UncategorizedBug

comment:2 Changed 6 years ago by Baptiste Mispelon

Cc: bmispelon@… added
Resolution: invalid
Status: newclosed

This is actually a documented behavior:

The UserCreationForm "must be re-written for any custom user model".

I'm therefore closing this as invalid but note that there is some discussion on ticket #19353 that relates to this issue.


Note: See TracTickets for help on using tickets.
Back to Top