Opened 12 years ago

Closed 12 years ago

#19150 closed Cleanup/optimization (fixed)

Presence of USERNAME_FIELD in REQUIRED_FIELDS should be validated

Reported by: Russell Keith-Magee Owned by: nobody
Component: contrib.auth Version: 1.4
Severity: Release blocker Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Reported via Chris Pagnutti <chris.pagnutti@…> on django-users:

The documentation says that when specifying a custom User model, USERNAME_FIELD *must not* be present in REQUIRED_FIELDS. However, there's no validation that this is actually true.

This is an easy condition to check, so we should do so.

In an ideal world, this validation would be abstracted out to the actual base User model - however, the current validation tools aren't abstracted at all. As a temporary measure, a specific AUTH_USER_MODEL check in validation.py may be required, pending a larger refactor of the validation system.

Marking as release blocker because it's a major improvement to a new feature.

Change History (1)

comment:1 by Russell Keith-Magee <russell@…>, 12 years ago

Resolution: fixed
Status: newclosed

In 7a908747a52f7cc12d7006058daad6a6c973c462:

Fixed #19150 -- Added validation for USERNAME_FIELD being included in REQUIRED_FIELDS.

Thanks to Chris Pagnutti for the suggestion.

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