Fixed #204 -- Changed 'django-admin createsuperuser' to disallow blank passwords
git-svn-id: http://code.djangoproject.com/svn/django/trunk@314 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
1484f2e225
commit
e207378ad3
|
@ -401,9 +401,13 @@ def createsuperuser():
|
|||
while 1:
|
||||
password = getpass.getpass()
|
||||
password2 = getpass.getpass('Password (again): ')
|
||||
if password == password2:
|
||||
break
|
||||
sys.stderr.write("Error: Your passwords didn't match.\n")
|
||||
if password != password2:
|
||||
sys.stderr.write("Error: Your passwords didn't match.\n")
|
||||
continue
|
||||
if password.strip() == '':
|
||||
sys.stderr.write("Error: Blank passwords aren't allowed.\n")
|
||||
continue
|
||||
break
|
||||
except KeyboardInterrupt:
|
||||
sys.stderr.write("\nOperation cancelled.\n")
|
||||
sys.exit(1)
|
||||
|
|
Loading…
Reference in New Issue