Code

Opened 5 months ago

Closed 5 months 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

Description

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

Attachments (0)

Change History (1)

comment:1 Changed 5 months ago by alasdair

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.