#30066: UserManager.create_superuser doesn't allow for omitting email or 
password,
unlike create_user which does.
-------------------------------------+-------------------------------------
     Reporter:  Joshua Cannon        |                    Owner:  Abhishek
         Type:                       |  Bera
  Cleanup/optimization               |                   Status:  assigned
    Component:  contrib.auth         |                  Version:  2.1
     Severity:  Normal               |               Resolution:
     Keywords:  create_superuser     |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

 * needs_better_patch:  0 => 1


Comment:

 
[https://docs.djangoproject.com/en/dev/topics/auth/customizing/#django.contrib.auth.models.CustomUserManager.create_superuser
 The documentation] says, The prototype of `create_superuser()` should
 accept the username field, plus all required fields as arguments." and
 "Unlike `create_user()`, `create_superuser()` must require the caller to
 provide a password."

 For the default user mode, `User.REQUIRED_FIELDS = ['email']` so that
 explains the original implementation. The documentation for
 `CustomUserManager.create_user()` wasn't updated after
 f54135fa4dc9fd45d86ea2944191d58e00725779. It still says, "The prototype of
 `create_user()` should accept the username field, plus all required fields
 as arguments." which is violated for the default case.

 I don't have a strong opinion about how to proceed but if we proceed with
 the changes, some documentation changes are required.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30066#comment:4>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.680fd4fe0f12a7d9c6b53339ed3fec51%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to