Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 authored July 26, 2005

Showing 1 changed file with 7 additions and 3 deletions. Show diff stats Hide diff stats

  1. 10  django/core/management.py
10  django/core/management.py
@@ -401,9 +401,13 @@ def createsuperuser():
401 401
         while 1:
402 402
             password = getpass.getpass()
403 403
             password2 = getpass.getpass('Password (again): ')
404  
-            if password == password2:
405  
-                break
406  
-            sys.stderr.write("Error: Your passwords didn't match.\n")
  404
+            if password != password2:
  405
+                sys.stderr.write("Error: Your passwords didn't match.\n")
  406
+                continue
  407
+            if password.strip() == '':
  408
+                sys.stderr.write("Error: Blank passwords aren't allowed.\n")
  409
+                continue
  410
+            break
407 411
     except KeyboardInterrupt:
408 412
         sys.stderr.write("\nOperation cancelled.\n")
409 413
         sys.exit(1)

0 notes on commit e207378

Please sign in to comment.
Something went wrong with that request. Please try again.