[Django] #28044: Different logic in createsuperuser command between interactive and non-interactive mode

8 views
Skip to first unread message

Django

unread,
Apr 6, 2017, 2:42:31 PM4/6/17
to django-...@googlegroups.com
#28044: Different logic in createsuperuser command between interactive and non-
interactive mode
-------------------------------------+-------------------------------------
Reporter: Sławek | Owner: nobody
Ehlert |
Type: | Status: assigned
Uncategorized |
Component: | Version: master
contrib.auth | Keywords: createsuperuser
Severity: Normal | management command
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Currently the {{{createsuperuser}}} management command logic differs when
running in non-interactive mode ({{{--no-input}}} option) and in
interactive mode (the default).

Here's a summary of what it does currently.

In **interactive** mode:
- checks if stdin is a TTY (obviously),
- checks if provided user already exists (before creating it),
- provides "fake_user_data" for the case where User model has FKs to other
models,
- validates provided password.

In **non-interactive** mode:
- cleans every required field and a {{{USERNAME_FIELD}}} (fix for
interactive mode is already in #28016),
- doesn't allow to provide password (there's #27801 for this case - I
already did some work on that ticket).

I think it would be good to combine the logic for both modes before
tackling #27801. That would also make #28016 obsolete.

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

Django

unread,
Apr 6, 2017, 2:42:53 PM4/6/17
to django-...@googlegroups.com
#28044: Different logic in createsuperuser command between interactive and non-
interactive mode
-------------------------------------+-------------------------------------
Reporter: Sławek Ehlert | Owner: Sławek
| Ehlert
Type: Uncategorized | Status: assigned
Component: contrib.auth | Version: master
Severity: Normal | Resolution:
Keywords: createsuperuser | Triage Stage:
management command | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sławek Ehlert):

* owner: nobody => Sławek Ehlert


--
Ticket URL: <https://code.djangoproject.com/ticket/28044#comment:1>

Django

unread,
Apr 7, 2017, 5:06:20 AM4/7/17
to django-...@googlegroups.com
#28044: Different logic in createsuperuser command between interactive and non-
interactive mode
-------------------------------------+-------------------------------------
Reporter: Sławek Ehlert | Owner: Sławek
Type: | Ehlert
Cleanup/optimization | Status: assigned

Component: contrib.auth | Version: master
Severity: Normal | Resolution:
Keywords: createsuperuser | Triage Stage: Accepted
management command |
Has patch: 0 | Needs documentation: 1

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Markus Holtermann):

* needs_docs: 0 => 1
* type: Uncategorized => Cleanup/optimization
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/28044#comment:2>

Django

unread,
Aug 14, 2017, 8:14:39 AM8/14/17
to django-...@googlegroups.com
#28044: Different logic in createsuperuser command between interactive and non-
interactive mode
-------------------------------------+-------------------------------------
Reporter: Sławek Ehlert | Owner: DoHyun
Type: | Kim

Cleanup/optimization | Status: assigned
Component: contrib.auth | Version: master
Severity: Normal | Resolution:
Keywords: createsuperuser | Triage Stage: Accepted
management command |
Has patch: 0 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by DoHyun Kim):

* owner: Sławek Ehlert => DoHyun Kim


--
Ticket URL: <https://code.djangoproject.com/ticket/28044#comment:3>

Django

unread,
Jan 9, 2018, 10:45:37 AM1/9/18
to django-...@googlegroups.com
#28044: Different logic in createsuperuser command between interactive and non-
interactive mode
-------------------------------------+-------------------------------------
Reporter: Sławek Ehlert | Owner: DoHyun
Type: | Kim
Cleanup/optimization | Status: assigned
Component: contrib.auth | Version: master
Severity: Normal | Resolution:
Keywords: createsuperuser | Triage Stage: Accepted
management command |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* needs_better_patch: 0 => 1
* has_patch: 0 => 1
* needs_docs: 1 => 0


Comment:

[https://github.com/django/django/pull/8908 PR] (needs some improvements)

--
Ticket URL: <https://code.djangoproject.com/ticket/28044#comment:4>

Django

unread,
May 29, 2018, 8:42:18 AM5/29/18
to django-...@googlegroups.com
#28044: Different logic in createsuperuser command between interactive and non-
interactive mode
-------------------------------------+-------------------------------------
Reporter: Sławek Ehlert | Owner: DoHyun
Type: | Kim
Cleanup/optimization | Status: closed
Component: contrib.auth | Version: master
Severity: Normal | Resolution: fixed

Keywords: createsuperuser | Triage Stage: Accepted
management command |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"f1f4aeb22e7bc9b504f69f7cb111ac9bdedb5f1e" f1f4aeb2]:
{{{
#!CommitTicketReference repository=""
revision="f1f4aeb22e7bc9b504f69f7cb111ac9bdedb5f1e"
Fixed #28044 -- Unified the logic for createsuperuser's interactive and
--noinput modes.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28044#comment:5>

Reply all
Reply to author
Forward
0 new messages