Opened 5 years ago
Closed 5 years ago
#31878 closed Bug (fixed)
Default username in createsuperuser command doesn't respect the --database option.
| Reported by: | Yan Mitrofanov | Owned by: | Yan Mitrofanov |
|---|---|---|---|
| Component: | contrib.auth | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
The createsuperuser command in interactive mode suggests to leave username blank and use the default name (django.contrib.auth.management.get_default_username). The default name is validated to not be already used by an another user. This validation executes a query on User model using default database and not using the database option passed to the command.
This is the problem when you are using multiple databases.
Change History (6)
comment:1 by , 5 years ago
| Type: | Uncategorized → Bug |
|---|
comment:2 by , 5 years ago
| Summary: | Default username in "createsuperuser" command is always validated in the default database → Default username in createsuperuser command doesn't respect the --database option. |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
| Version: | 2.2 → master |
comment:3 by , 5 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:5 by , 5 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
Note:
See TracTickets
for help on using tickets.
Agreed, we should pass
databaseto theget_default_username().