Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#25457 closed Bug (fixed)

createsuperuser password error message has incorrect format

Reported by: Tzu-ping Chung Owned by: nobody
Component: contrib.auth Version: 1.9a1
Severity: Normal Keywords: 1.9
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: yes

Description

$ ./manage.py createsuperuser
Username (leave blank to use 'uranusjr'): 
Email address: 
Password: 
Password (again): 
This password is too short. It must contain at least 8 characters., This password is too common.

The problem is likely in “django/contrib/auth/management/commands/createsuperuser.py”, where error message is currently formatted like this:

try:
    validate_password(password2, self.UserModel(**fake_user_data))
except exceptions.ValidationError as err:
    self.stderr.write(', '.join(err.messages))
    password = None

So either the exception message needs to be re-formatted to not using a complete sentence, or the messages need to be joined without the comma.

Change History (5)

comment:1 by Tim Graham, 9 years ago

Easy pickings: set
Keywords: 1.9 added
Triage Stage: UnreviewedAccepted

It seems that joining with a newline could be appropriate.

comment:3 by Tzu-ping Chung, 9 years ago

Has patch: set

comment:4 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: newclosed

In 9581ac39:

[1.9.x] Fixed #25457 -- Improved formatting of password validation errors in management command output.

Backport of 7372cdebed19a9d8e5527823c1e6825156babf98 from master

comment:5 by Tim Graham <timograham@…>, 9 years ago

In 7372cdeb:

Fixed #25457 -- Improved formatting of password validation errors in management command output.

Note: See TracTickets for help on using tickets.
Back to Top