Opened 7 weeks ago

Last modified 6 weeks ago

#28667 assigned Cleanup/optimization

Documentation for extending UserCreationForm doesn't work with UserAdmin

Reported by: Nathanael Gordon Owned by: messfish
Component: contrib.auth Version: 1.11
Severity: Normal Keywords: add_fieldsets UserAdmin UserCreationForm Custom Auth User Model
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

In the docs for customising the Auth User model it does not fully outline the link between the UserCreationForm and the UserAdmin - specifically the fact that the UserAdmin's add_fieldsets will be used rather than the fields attribute in the Meta for the custom UserCreationForm.

At the end of this section (https://docs.djangoproject.com/en/1.11/topics/auth/customizing/#custom-users-and-the-built-in-auth-forms) it specifies that one can simply override the fields in the Meta of one's UserCreationForm. However, as the UserAdmin uses a custom get_fieldsets method which uses its add_fieldsets attribute instead, overriding fields does nothing.

Change History (2)

comment:1 Changed 7 weeks ago by Tim Graham

Summary: Lack of clear documentation for custom UserCreationForm when using a custom User modelDocumentation for extending UserCreationForm doesn't work with UserAdmin
Triage Stage: UnreviewedAccepted
Type: BugCleanup/optimization

comment:2 Changed 6 weeks ago by messfish

Owner: changed from nobody to messfish
Status: newassigned

I would like to fix this minor problem to let me have a better grasp of django.

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