Presence of USERNAME_FIELD in REQUIRED_FIELDS should be validated
|Reported by:||Russell Keith-Magee||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
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.