#31289: system checks: admin.E002 could provide a hint but doesn't
------------------------------------------------+------------------------
               Reporter:  Keryn Knight          |          Owner:  nobody
                   Type:  New feature           |         Status:  new
              Component:  Core (System checks)  |        Version:  3.0
               Severity:  Normal                |       Keywords:
           Triage Stage:  Unreviewed            |      Has patch:  0
    Needs documentation:  0                     |    Needs tests:  0
Patch needs improvement:  0                     |  Easy pickings:  1
                  UI/UX:  0                     |
------------------------------------------------+------------------------
 Currently the output is:

 {{{
 myapp.MyCustomUserModel: (auth.E002) The field named as the
 'USERNAME_FIELD' for a custom user model must not be included in
 'REQUIRED_FIELDS'.
 }}}

 because I accidentally had:
 {{{
 USERNAME_FIELD = "email"
 EMAIL_FIELD = "email"
 REQUIRED_FIELDS = (USERNAME_FIELD, "full_name",)
 }}}

 Ignoring the fact that Django **knows** it's wrong to have it in there,
 and could easily just skip it or warn if it's not set, it doesn't make use
 of the hints available in system checks.

 I'd like to suggest that a hint could be provided which says which field
 it's moaning about, something like (open to better wording):
 {{{
 HINT: Your username field is currently set to "email", you should remove
 "email" from your required fields definition.
 }}}

 It's a stupidly little thing, but having not had to make a custom user
 from scratch for a while, my eyes glazed over the **not** in ` must not be
 ` and I was confused for all of 2 minutes before actually reading it
 properly.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31289>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.f6fa64db0208d158df8e0000ff8c5eff%40djangoproject.com.

Reply via email to