Opened 3 years ago

Closed 3 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 3 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

comment:2 Changed 3 years ago by bmispelon

  • Cc bmispelon@… added
  • Resolution set to invalid
  • Status changed from new to closed

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