diff options
| author | aryan <aryan@Aryans-MacBook-Pro.local> | 2020-02-20 23:46:59 +0530 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-02-26 08:40:36 +0100 |
| commit | fba5d3b6e63fe4a07b1aa133186f997eeebf9aeb (patch) | |
| tree | 0ff08cec7db38b85efcc0a5510959acccf6f2308 /django | |
| parent | 5637933268af9a7fbf69d162d686a9929903ff47 (diff) | |
Fixed #31289 -- Added hint for USERNAME_FIELD/REQUIRED_FIELDS system check.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/auth/checks.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/django/contrib/auth/checks.py b/django/contrib/auth/checks.py index 163199ce54..65fc266f7e 100644 --- a/django/contrib/auth/checks.py +++ b/django/contrib/auth/checks.py @@ -41,6 +41,11 @@ def check_user_model(app_configs=None, **kwargs): checks.Error( "The field named as the 'USERNAME_FIELD' " "for a custom user model must not be included in 'REQUIRED_FIELDS'.", + hint=( + "The 'USERNAME_FIELD' is currently set to '%s', you " + "should remove '%s' from the 'REQUIRED_FIELDS'." + % (cls.USERNAME_FIELD, cls.USERNAME_FIELD) + ), obj=cls, id='auth.E002', ) |
