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.
In 7a908747a52f7cc12d7006058daad6a6c973c462: