Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-08-08 Thread Django
#34542: Required fields allowed to be blank are not accepted non-interactively
using createsuperuser
-+-
 Reporter:  Lantizia |Owner:  Mateusz
 |  Więckowski
 Type:  Bug  |   Status:  closed
Component:  contrib.auth |  Version:  dev
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  auth | Triage Stage:  Ready for
  createsuperuser superuser email|  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Mariusz Felisiak ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"5aa4c0b67549f1d7ab649f53ac782d8de3e6a87c" 5aa4c0b]:
 {{{
 #!CommitTicketReference repository=""
 revision="5aa4c0b67549f1d7ab649f53ac782d8de3e6a87c"
 Fixed #34542 -- Made createsuperuser handle required blank fields in non-
 interactive mode.
 }}}

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070189d44a9d0b-51d1380f-1e16-4902-a9f7-74d4961ac055-00%40eu-central-1.amazonses.com.


Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-08-08 Thread Django
#34542: Required fields allowed to be blank are not accepted non-interactively
using createsuperuser
-+-
 Reporter:  Lantizia |Owner:  Mateusz
 |  Więckowski
 Type:  Bug  |   Status:  assigned
Component:  contrib.auth |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  auth | Triage Stage:  Ready for
  createsuperuser superuser email|  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * needs_better_patch:  1 => 0
 * stage:  Accepted => Ready for checkin


-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070189d40bc37f-d02be102-085a-4e3e-83e9-bbd7b464fd18-00%40eu-central-1.amazonses.com.


Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-07-31 Thread Django
#34542: Required fields allowed to be blank are not accepted non-interactively
using createsuperuser
-+-
 Reporter:  Lantizia |Owner:  Mateusz
 |  Więckowski
 Type:  Bug  |   Status:  assigned
Component:  contrib.auth |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  auth | Triage Stage:  Accepted
  createsuperuser superuser email|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Natalia Bidart):

 * needs_better_patch:  0 => 1


-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070189ad380794-a6d00288-e779-452d-b492-3aa9db2d2aed-00%40eu-central-1.amazonses.com.


Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-07-31 Thread Django
#34542: Required fields allowed to be blank are not accepted non-interactively
using createsuperuser
-+-
 Reporter:  Lantizia |Owner:  Mateusz
 |  Więckowski
 Type:  Bug  |   Status:  assigned
Component:  contrib.auth |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  auth | Triage Stage:  Accepted
  createsuperuser superuser email|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Mateusz Więckowski):

 * owner:  Anvansh Singh => Mateusz Więckowski
 * has_patch:  0 => 1


-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070189ace9b529-cc1601b7-5a21-475a-8d61-5cee6907cf5b-00%40eu-central-1.amazonses.com.


Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-07-26 Thread Django
#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 Sarah Boyce):

 Replying to [comment:23 Mateusz Więckowski]:
 >
 > At the moment I am confident that my current solution works, but before
 doing the PR I have just one question - should I write tests as well? In
 the ticket details, it says 'Needs tests: no', but in the guide about
 creating a PR, it's mentioned that tests are always needed, except for
 documentation changes.

 Yes you should write tests. The 'Needs tests' area of the ticket is marked
 as 'Yes' when there was a patch that got reviewed and it was missing
 tests, then this is part of the feedback as to why the patch has not been
 accepted. 👍

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701899406b25b-c7228501-3979-4494-95df-cf58a1332389-00%40eu-central-1.amazonses.com.


Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-07-25 Thread Django
#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 Mateusz Więckowski):

 Replying to [comment:20 Natalia Bidart]:
 > Hello Mateusz,
 >
 > Did you run the examples above with or without your changes? Using
 Django main, this is what I get:
 >
 > {{{
 > $ DJANGO_SUPERUSER_EMAIL="" python -Wall manage.py createsuperuser
 --username testing --noinput
 > CommandError: You must use --email with --noinput.
 > }}}
 >
 > If you are confident that your proposal is correct and works for every
 case, then please create a PR and I'll happily review. Thanks!

 I ran the examples with my changes. I found one case with environmental
 variables that wasn't working, but managed to fix it.

 At the moment I am confident that my current solution works, but before
 doing the PR I have just one question - should I write tests as well? In
 the ticket details, it says 'Needs tests: no', but in the guide about
 creating a PR, it's mentioned that tests are always needed, except for
 documentation changes.

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701898da0f5ca-43e2db28-9115-42a4-9581-a918b72ab874-00%40eu-central-1.amazonses.com.


Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-07-25 Thread Django
#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 Mateusz Więckowski):

 Replying to [comment:21 Lufafa Joshua]:
 >
 > Replying to [# Mateusz Więckowski]:
 > >I'm using cmd. I did some changes to "non-interactive" part in Django's
 createsuperuser.py
 > >It's rather quick, so you could do it yourself and check:
 > >Move this line:
 >
 >​https://github.com/django/django/blob/main/django/contrib/auth/management/commands/createsuperuser.py#L226
 > >above the if statement at the line 222
 > >In the if itself add the following:
 > >{{{
 > >if field.blank and options[field_name] is not None:
 > >continue
 > >}}}
 > Hey,  Considering your approach, instead of using:
 >
 > {{{
 > if field.blank and options[field_name] is not None:
 > continue
 > }}}
 > I have used
 > {{{
 > if field.blank:
 > continue
 > }}}
 > and it seems to bypass the exception if the field is allowed to be blank
 while using environment variable or {{{--noinput}}}
 >
 >
 >
 >
 >
 >
 Hey, that was my initial approach, but it creates unwanted behavior that
 is described in comments: #comment:13 and #comment:14.

 I've also found that this:

 {{{
 if field.blank and options[field_name] is not None:
 continue
 }}}
 Doesn't work for all cases when setting DJANGO_SUPERUSER_EMAIL.

 My current approach looks like this and works for all cases I could've
 found.
 {{{
 if not value:
 if (field.blank and
 (options[field_name] is not None or
 os.environ.get(env_var) is not None)):
 continue
 }}}

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701898d9e1f2b-78d6593b-cd24-49a1-aca6-4af22af8470f-00%40eu-central-1.amazonses.com.


Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-07-25 Thread Django
#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 Lufafa Joshua):

 Replying to [# Mateusz Więckowski]:
 >I'm using cmd. I did some changes to "non-interactive" part in Django's
 createsuperuser.py
 >It's rather quick, so you could do it yourself and check:
 >Move this line:
 >​https://github.com/django/django/blob/main/django/contrib/auth/management/commands/createsuperuser.py#L226
 >above the if statement at the line 222
 >In the if itself add the following:
 >{{{
 >if field.blank and options[field_name] is not None:
 >continue
 >}}}
 Hey,  Considering your approach, instead of using:

 {{{
 if field.blank and options[field_name] is not None:
 continue
 }}}
 I have used
 {{{
 if field.blank:
 continue
 }}}
 and it seems to bypass the exception if the field is allowed to be blank
 while using environment variable or {{{--noinput}}}

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701898d88b55e-71e343a6-690e-4c43-8831-9f58c41a3ca5-00%40eu-central-1.amazonses.com.


Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-07-25 Thread Django
#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):

 Hello Mateusz,

 Did you run the examples above with or without your changes? Using Django
 main, this is what I get:

 {{{
 $ DJANGO_SUPERUSER_EMAIL="" python -Wall manage.py createsuperuser
 --username testing --noinput
 CommandError: You must use --email with --noinput.
 }}}

 If you are confident that your proposal is correct and works for every
 case, then please create a PR and I'll happily review. Thanks!

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701898d15aba2-57e820d0-1c5b-4883-896d-9cd8d6f19039-00%40eu-central-1.amazonses.com.


Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-07-25 Thread Django
#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 Mateusz Więckowski):

 When passing DJANGO_SUPERUSER_EMAIL:

 {{{
 py manage.py createsuperuser --username username
 }}}
 Prompts for email, allows it to be blank, doesn't get value from
 DJANGO_SUPERUSER_EMAIL.

 {{{
 py manage.py createsuperuser --email "" --username username
 }}}
 Doesn't prompt for email, doesn't get value from DJANGO_SUPERUSER_EMAIL,
 sets email blank.

 {{{
 py manage.py createsuperuser --email "" --username username --noinput
 py manage.py createsuperuser --username username --noinput
 }}}
 Doesn't prompt, gets value from DJANGO_SUPERUSER_EMAIL.

 I believe it works how it's supposed to. Is that correct?

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701898c7369c6-c83396b0-a2f9-480a-9adf-fe6d9a7ea07f-00%40eu-central-1.amazonses.com.


Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-07-20 Thread Django
#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:17 Mateusz Więckowski]:
 > I'm using cmd. I did some changes to "non-interactive" part in Django's
 createsuperuser.py
 >
 > It's rather quick, so you could do it yourself and check:
 > Move this line:
 >
 
https://github.com/django/django/blob/main/django/contrib/auth/management/commands/createsuperuser.py#L226
 > above the if statement at the line 222
 > In the if itself add the following:
 > {{{
 > if field.blank and options[field_name] is not None:
 > continue
 > }}}
 >

 Would you like to prepare a patch/PR? Please note that the solution should
 also work when passing the env var `DJANGO_SUPERUSER_EMAIL` (on both
 interactive and `--noinput` mode).

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018973197d24-7095be37-0290-4aa6-8136-84acb542d8d2-00%40eu-central-1.amazonses.com.


Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-07-17 Thread Django
#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 Mateusz Więckowski):

 I'm using cmd. I did some changes to "non-interactive" part in Django's
 createsuperuser.py

 It's rather quick, so you could do it yourself and check:
 Move this line:
 
https://github.com/django/django/blob/main/django/contrib/auth/management/commands/createsuperuser.py#L226
 above the if statement at the line 222
 In the if itself add the following:
 {{{
 if field.blank and options[field_name] is not None:
 continue
 }}}

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070189677e4d85-3fb601f7-6b63-4cc0-82f7-5436ef76129f-00%40eu-central-1.amazonses.com.


Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-07-17 Thread Django
#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:15 Mateusz Więckowski]:
 > Okay, got It. This is how it works for me now:
 >
 >
 > {{{
 > py manage.py createsuperuser --username testing --noinput
 > CommandError: You must use --email with --noinput.
 >
 > py manage.py createsuperuser --email "" --username testing --noinput
 > Superuser created successfully.
 > }}}
 >
 > I did not change anything for the "interactive" part of the process - as
 far as I've understood from the comments it works as intended.

 Thanks for sharing this. What shell are you using? I'm using bash on an
 ubuntu system with Python 3.11, and I get this:

 {{{
 $ python -Wall manage.py createsuperuser --email "" --username testing
 --noinput
 CommandError: You must use --email with --noinput.
 }}}

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018964107de7-d8b91fa1-4dbb-419d-9636-419f4f0a2d7a-00%40eu-central-1.amazonses.com.


Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-07-16 Thread Django
#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 Mateusz Więckowski):

 Okay, got It. This is how it works for me now:


 {{{
 py manage.py createsuperuser --username testing --noinput
 CommandError: You must use --email with --noinput.

 py manage.py createsuperuser --email "" --username testing --noinput
 Superuser created successfully.
 }}}

 I did not change anything for the "interactive" part of the process - as
 far as I've understood from the comments it works as intended.

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018962746723-408af2b7-39ae-4b29-88f8-3b2b00f44f0d-00%40eu-central-1.amazonses.com.


Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-07-14 Thread Django
#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):

 Hello Mateusz, the goal for the fix is to allow the email value to be
 blank, not to allow it to be missing. So basically an invocation with
 `--email ""` should succeed but not passing `--email` at all should fail
 for `noinput` or should prompt for `email` if interactive.

 Does that make sense?

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018955deb919-5ce2af37-f97e-43a6-ace7-349ab7efeab4-00%40eu-central-1.amazonses.com.


Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-07-07 Thread Django
#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 Mateusz Więckowski):

 Hi! I'm not entirely sure that I understood the problem, but if so, I do
 believe I have created a solution.

 In the 'non-interactive' part of the code where the error is thrown (e.g.,
 CommandError: You must use --email with --noinput), I added a block of
 code that checks if the field is allowed to be blank. If that's the case,
 I simply do not raise the error.

 This is how it works for me now:
 {{{
 py manage.py createsuperuser --username username --noinput

 Superuser created successfully.
 }}}

 Let me know if that's what was the issue with this one.

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018931731db0-64686752-909c-4f5f-a33a-e729358db56e-00%40eu-central-1.amazonses.com.


Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-06-19 Thread Django
#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):

 Syed, can you please your whole invocation and shell result? For me, your
 command prompts for password:

 {{{
 $ python manage.py createsuperuser --email "" --user admin
 Password:
 Operation cancelled.
 }}}

 And when passing `--nopinput`, I get an error:

 {{{
 $ python manage.py createsuperuser --email "" --user admin --noinput
 CommandError: You must use --email with --noinput.
 }}}

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070188d36039e9-62e14bfe-7143-4ae9-9369-9c68812af9ab-00%40eu-central-1.amazonses.com.


Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-06-17 Thread Django
#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 SyedMa3):

 Replying to [ticket:34542 Lantizia]:
 > I've only encountered Django once before (installing mailman3), but this
 time I was trying to install NetBox and I noticed this sentence in their
 documentation...
 >
 > "Specifying an email address for the user is not required"  (search for
 that line in the URL below for better context)
 >
 > [https://docs.netbox.dev/en/stable/installation/3-netbox/]
 >
 > According to these lines...
 [https://github.com/django/django/blob/main/django/contrib/auth/models.py#L378]
 and
 [https://github.com/django/django/blob/main/django/contrib/auth/models.py#L358]
 >
 > The 'email' field is marked as required, but is also marked in a way to
 allow it to be empty.
 >
 > This section of the code validates required fields when createsuperuser
 is called **interactively**...
 
[https://github.com/django/django/blob/main/django/contrib/auth/management/commands/createsuperuser.py#L143]
 >
 > This section of the code validates required fields when createsuperuser
 is called **non-interactively**...
 
[https://github.com/django/django/blob/main/django/contrib/auth/management/commands/createsuperuser.py#L219]
 >
 > Although required fields are enforced, the **non-interactive** code
 doesn't allow for those to be blank, where blank required fields are
 permitted.  I've tried to set a field like 'email' to blank **non-
 interactively** but nothing works, for example...
 >
 > a) just don't set the email field either through an argument or an
 environment variable... it'll complain it is needed
 > b) set the email field via a variable as just 'DJANGO_SUPERUSER_EMAIL='
 (i.e. setting the variable to null)... it still complains it is needed
 > c) set the email field via an argument of --email '' (i.e. double
 quotes) or --email "" (i.e. double single quotes) or even --email \  (i.e.
 passing a single space)... it still complains it is needed
 >
 > Hope this makes sense :)


 I just tried making a superuser non-interactively using the command

 `python manage.py createsuperuser --email "" --user admin`

 and it works without any error.

 Is this bug still valid? @Lantizia

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070188c941a31b-3caf6cdf-0fd7-401c-bb10-56596e6b0748-00%40eu-central-1.amazonses.com.


Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-05-24 Thread Django
#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 "a...@b.com"  --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: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701884de7d856-2d932585-69f7-4855-b163-2859bfa96f79-00%40eu-central-1.amazonses.com.


Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-05-20 Thread Django
#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 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 "a...@b.com"  --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
 }}}

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

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701883aab7ed6-fa523456-e3b2-4abc-92b6-ae31554465f5-00%40eu-central-1.amazonses.com.


Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-05-10 Thread Django
#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
-+-
Changes (by Anvansh Singh):

 * owner:  nobody => Anvansh Singh
 * status:  new => assigned


Comment:

 I will be preparing a patch for it. Will send it out by next wednesday.

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070188097acef2-fd255f57-4aa6-460b-8f85-bc8337ff3791-00%40eu-central-1.amazonses.com.


Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-05-09 Thread Django
#34542: Required fields allowed to be blank are not accepted non-interactively
using createsuperuser
-+-
 Reporter:  Lantizia |Owner:  (none)
 Type:  Bug  |   Status:  new
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
-+-
Changes (by ATausif):

 * owner:  ATausif => (none)
 * status:  assigned => new


-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070188006f5071-8b9bb96e-9914-417c-b85d-15fe6e8e7420-00%40eu-central-1.amazonses.com.


Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-05-09 Thread Django
#34542: Required fields allowed to be blank are not accepted non-interactively
using createsuperuser
-+-
 Reporter:  Lantizia |Owner:  ATausif
 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
-+-
Changes (by ATausif):

 * owner:  nobody => ATausif
 * status:  new => assigned


-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070188006ddee2-b3ac7a90-f9f6-4ae9-83ed-1d8f2d0dd687-00%40eu-central-1.amazonses.com.


Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-05-09 Thread Django
#34542: Required fields allowed to be blank are not accepted non-interactively
using createsuperuser
-+-
 Reporter:  Lantizia |Owner:  nobody
 Type:  Bug  |   Status:  new
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
-+-
Changes (by Natalia Bidart):

 * stage:  Unreviewed => Accepted


Comment:

 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?

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070188006b44e7-e1fe6ce7-3603-4ed2-8c57-e74665ecca19-00%40eu-central-1.amazonses.com.


Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser

2023-05-08 Thread Django
#34542: Required fields allowed to be blank are not accepted non-interactively
using createsuperuser
-+-
 Reporter:  Lantizia |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  contrib.auth |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  auth | Triage Stage:
  createsuperuser superuser email|  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Description changed by Lantizia:

Old description:

> I've only encountered Django once before (installing mailman3), but this
> time I was trying to install NetBox and I noticed this sentence in their
> documentation...
>
> "Specifying an email address for the user is not required"  (search for
> that line in the URL below for better context)
>
> [https://docs.netbox.dev/en/stable/installation/3-netbox/]
>
> According to this line...
> [https://github.com/django/django/blob/main/django/contrib/auth/models.py#L378]
>
> The 'email' field is marked as required, but is also marked in a way to
> allow it to be empty.
>
> This is the section of the code that deals with validating required
> fields when createsuperuser is called **interactively**...
> [https://github.com/django/django/blob/main/django/contrib/auth/management/commands/createsuperuser.py#L143]
>
> This is the section of the code that deals with validating required
> fields when createsuperuser is called **non-interactively**...
> [https://github.com/django/django/blob/main/django/contrib/auth/management/commands/createsuperuser.py#L219]
>
> Although required fields are enforced, the **non-interactive** code
> doesn't allow for those to be blank, where blank required fields are
> permitted.  I've tried to set a field like 'email' to blank **non-
> interactively** but nothing works, for example...
>
> a) just don't set the email field either through an argument or an
> environment variable... it'll complain it is needed
> b) set the email field via a variable as just 'DJANGO_SUPERUSER_EMAIL='
> (i.e. setting the variable to null)... it still complains it is needed
> c) set the email field via an argument of --email '' (i.e. double quotes)
> or --email "" (i.e. double single quotes) or even --email \  (i.e.
> passing a single space)... it still complains it is needed
>
> Hope this makes sense :)

New description:

 I've only encountered Django once before (installing mailman3), but this
 time I was trying to install NetBox and I noticed this sentence in their
 documentation...

 "Specifying an email address for the user is not required"  (search for
 that line in the URL below for better context)

 [https://docs.netbox.dev/en/stable/installation/3-netbox/]

 According to these lines...
 [https://github.com/django/django/blob/main/django/contrib/auth/models.py#L378]
 and
 [https://github.com/django/django/blob/main/django/contrib/auth/models.py#L358]

 The 'email' field is marked as required, but is also marked in a way to
 allow it to be empty.

 This section of the code validates required fields when createsuperuser is
 called **interactively**...
 
[https://github.com/django/django/blob/main/django/contrib/auth/management/commands/createsuperuser.py#L143]

 This section of the code validates required fields when createsuperuser is
 called **non-interactively**...
 
[https://github.com/django/django/blob/main/django/contrib/auth/management/commands/createsuperuser.py#L219]

 Although required fields are enforced, the **non-interactive** code
 doesn't allow for those to be blank, where blank required fields are
 permitted.  I've tried to set a field like 'email' to blank **non-
 interactively** but nothing works, for example...

 a) just don't set the email field either through an argument or an
 environment variable... it'll complain it is needed
 b) set the email field via a variable as just 'DJANGO_SUPERUSER_EMAIL='
 (i.e. setting the variable to null)... it still complains it is needed
 c) set the email field via an argument of --email '' (i.e. double quotes)
 or --email "" (i.e. double single quotes) or even --email \  (i.e. passing
 a single space)... it still complains it is needed

 Hope this makes sense :)

--

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To v

Re: [Django] #34542: Required fields allowed to be blank are not accepted non-interactively using createsuperuser (was: Required fields not enforced when interactively using createsuperuser)

2023-05-08 Thread Django
#34542: Required fields allowed to be blank are not accepted non-interactively
using createsuperuser
-+-
 Reporter:  Lantizia |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  contrib.auth |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  auth | Triage Stage:
  createsuperuser superuser email|  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Description changed by Lantizia:

Old description:

> Disclaimer: I really don't know much about Django... so I might be
> completely wrong on this.
>
> I've only encountered Django once before (installing mailman3), but this
> time I was trying to install NetBox and I noticed this sentence in their
> documentation...
>
> "Specifying an email address for the user is not required"  (search for
> that line in the URL below for better context)
>
> [https://docs.netbox.dev/en/stable/installation/3-netbox/]
>
> According to this line...
> [https://github.com/django/django/blob/main/django/contrib/auth/models.py#L378]
>
> The 'email' field is marked required.
>
> However this section of the code (which is when createsuperuser is called
> **interactively**)...
> [https://github.com/django/django/blob/main/django/contrib/auth/management/commands/createsuperuser.py#L143]
>
> It doesn't look like it's written in a way which can enforce that, as a
> result when you run it this way... it lets you to enter nothing for the
> email field.
>
> However this section of the code (which is when createsuperuser is called
> **non-interactively**)...
> [https://github.com/django/django/blob/main/django/contrib/auth/management/commands/createsuperuser.py#L219]
>
> Seems to enforce required fields... and it definitely seems to be doing
> that as I've tried the following ways of **not** providing a value for
> the email field in the following ways...
>
> a) don't set the email field either through an argument or an environment
> variable... it'll still complain it is needed
> b) set the email field via a variable as just 'DJANGO_SUPERUSER_EMAIL='
> (i.e. setting the variable to null)... it still complains it is needed
> c) set the email field via an argument of --email '' (i.e. double quotes)
> or --email "" (i.e. double single quotes) or even --email \  (i.e.
> passing a single space)... it still complains it is needed
>
> So it seems to be that... as least **non-interactively** it is doing what
> it is supposed to... and making the 'required' field of 'email' non-
> optional.  But **interactively** it is failing to do this.
>
> If that is right then the NetBox documentation is wrong (and I can let
> them know about that) as it would only be accidental that you're capable
> of not setting an email address for the superuser when using
> createsuperuser interactively.
>
> Hope this makes sense :)

New description:

 I've only encountered Django once before (installing mailman3), but this
 time I was trying to install NetBox and I noticed this sentence in their
 documentation...

 "Specifying an email address for the user is not required"  (search for
 that line in the URL below for better context)

 [https://docs.netbox.dev/en/stable/installation/3-netbox/]

 According to this line...
 [https://github.com/django/django/blob/main/django/contrib/auth/models.py#L378]

 The 'email' field is marked as required, but is also marked in a way to
 allow it to be empty.

 This is the section of the code that deals with validating required fields
 when createsuperuser is called **interactively**...
 
[https://github.com/django/django/blob/main/django/contrib/auth/management/commands/createsuperuser.py#L143]

 This is the section of the code that deals with validating required fields
 when createsuperuser is called **non-interactively**...
 
[https://github.com/django/django/blob/main/django/contrib/auth/management/commands/createsuperuser.py#L219]

 Although required fields are enforced, the **non-interactive** code
 doesn't allow for those to be blank, where blank required fields are
 permitted.  I've tried to set a field like 'email' to blank **non-
 interactively** but nothing works, for example...

 a) just don't set the email field either through an argument or an
 environment variable... it'll complain it is needed
 b) set the email field via a variable as just 'DJANGO_SUPERUSER_EMAIL='
 (i.e. setting the variable to null)... it still complains it is needed
 c) set the email field via an argument of --email '' (i.e. double quotes)
 or --email "" (i.e. double single quotes) or even --email \  (i.e. passin