Opened 8 years ago
Closed 7 years ago
#28044 closed Cleanup/optimization (fixed)
Different logic in createsuperuser command between interactive and non-interactive mode
Reported by: | Sławek Ehlert | Owned by: | DoHyun Kim |
---|---|---|---|
Component: | contrib.auth | Version: | dev |
Severity: | Normal | Keywords: | createsuperuser management command |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
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.
Change History (5)
comment:1 by , 8 years ago
Owner: | changed from | to
---|
comment:2 by , 8 years ago
Needs documentation: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → Cleanup/optimization |
comment:3 by , 7 years ago
Owner: | changed from | to
---|
comment:4 by , 7 years ago
Has patch: | set |
---|---|
Needs documentation: | unset |
Patch needs improvement: | set |
Note:
See TracTickets
for help on using tickets.
PR (needs some improvements)