Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #204 -- Changed 'django-admin createsuperuser' to disallow blan…

…k passwords

git-svn-id: http://code.djangoproject.com/svn/django/trunk@314 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit e207378ad36caf0cb322bb264b569e0d915963f4 1 parent 1484f2e
Adrian Holovaty adrianholovaty authored
Showing with 7 additions and 3 deletions.
  1. +7 −3 django/core/management.py
10 django/core/management.py
View
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.