'maas createsuperuser' errors out if no email address is entered.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
High
|
Jeroen T. Vermeulen | ||
maas (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Was getting MAAS setup on my system, just to play with it, and didn't enter an email address. The tool didn't complain about leaving the email address blank, but when the the tool exited the superuser wasn't created and an error message was displayed.
Here is the output (and yes, I tried to leave the password blank too.. but note the command complained about leaving it blank)
gaughen@glitter:~$ sudo maas createsuperuser
Username (leave blank to use 'root'): maas_admin
Email address:
Password:
Password (again):
Error: Blank passwords aren't allowed.
Password:
Password (again):
IntegrityError: duplicate key value violates unique constraint "auth_user_
DETAIL: Key (email)=() already exists.
I think the correct behavior, if the email address is truly required, is to produce an error message similar to when you try to leave the password blank.
Related branches
- Julian Edwards (community): Approve
-
Diff: 263 lines (+75/-37)8 files modifiedHACKING.txt (+5/-3)
INSTALL.txt (+9/-7)
docs/man/maas.8.rst (+2/-2)
man/maas.8 (+2/-2)
src/maasserver/management/commands/createadmin.py (+20/-6)
src/maasserver/templates/registration/login.html (+5/-2)
src/maasserver/tests/test_commands.py (+31/-14)
src/maasserver/tests/test_views_account.py (+1/-1)
Changed in maas: | |
milestone: | none → 14.04 |
assignee: | nobody → Jeroen T. Vermeulen (jtv) |
importance: | Undecided → High |
Changed in maas: | |
status: | New → Fix Committed |
Changed in maas: | |
status: | Fix Committed → Fix Released |
Changed in maas (Ubuntu): | |
status: | Confirmed → Fix Released |
For the historical record:
* createsuperuser is a Django built-in command, not our code.
* We have our own MAAS-tailored version, createadmin.
* The email field must be unique and non-null, but can be empty.
* MAAS already creates a system user with empty email address.
* A null email address would be the right way to do this, but Django's supports null values more or less as an afterthought.
The simple fix is to update the documentation, so it always points users to createadmin, not createsuperuser.