#34542: Required fields allowed to be blank are not accepted non-interactively
using createsuperuser
-------------------------------------+-------------------------------------
     Reporter:  Lantizia             |                    Owner:  Anvansh
                                     |  Singh
         Type:  Bug                  |                   Status:  assigned
    Component:  contrib.auth         |                  Version:  dev
     Severity:  Normal               |               Resolution:
     Keywords:  auth                 |             Triage Stage:  Accepted
  createsuperuser superuser email    |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Natalia Bidart):

 Replying to [comment:9 Mohit Singh Sinsniwal]:
 > Replying to [comment:7 Natalia Bidart]:
 > > Thanks Lantizia, you have a valid point, we could make the
 noninteractively process allow for the empty string for email, to match
 the behavior of the interactive and web experience, but only when either
 the `--email` or env var should be passed as such though.
 > >
 > > Would you like to prepare a patch?
 > I want to work on this. However, I would like to understand what we want
 to solve. If we give an email and username with --noinput, it does not
 require the password.
 > {{{
 > python3.11 manage.py createsuperuser --email "[email protected]"  --user mohitd
 --noinput
 > }}}
 >
 > And if we dont want to write the email, it will require the password.
 > {{{
 > python3.11 manage.py createsuperuser --email ""  --user mohite
 > }}}

 Hi! I'm not entirely sure what you are asking, since your original report
 was about using `--noinput` without passing an email explicitely. In the
 `--noinput` case, password is not asked via the prompt (but it's used from
 the env var if given), so we want something similar. So if the command is
 called with something like this:

 {{{
 python -Wall manage.py createsuperuser --username=adminusername --email
 --noinput
 }}}

 or this:

 {{{
 DJANGO_SUPERUSER_EMAIL= python -Wall manage.py createsuperuser
 --username=adminusername --noinput
 }}}


 the superuser should be created with no email. Password can be provided
 via the `DJANGO_SUPERUSER_PASSWORD` env var.


 > Do we want to create --noinput with no email? Because that means
 creating a superuser without giving an email and password

 We understood this was your ask in the bug report. If it wasn't, what's
 your expected outcome then?
 Thanks!

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34542#comment:10>
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/010701884de7d856-2d932585-69f7-4855-b163-2859bfa96f79-000000%40eu-central-1.amazonses.com.

Reply via email to