Opened 5 years ago

Closed 5 years ago

#21407 closed Uncategorized (invalid)

Can't create new user in admin when having a custom user model

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


The built in UserCreationForm is (I think accidently) referencing "User" specifically, instead of using get_user_model for this. In effect, you get a SQL error when trying to create a new user with a custom user model:

17:37:11 web.1 | ProgrammingError: relation "auth_user" does not exist
17:37:11 web.1 | LINE 1: ...user"."is_active", "auth_user"."date_joined" FROM "auth_user...

This is in django 1.6

Change History (1)

comment:1 Changed 5 years ago by alasdair

Resolution: invalid
Status: newclosed

This is a duplicate of #20086, which was closed as invalid.

The user creation form is working as documented. It depends on the user model, and must be re-written for any custom model.

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