From e207378ad36caf0cb322bb264b569e0d915963f4 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Tue, 26 Jul 2005 14:37:00 +0000 Subject: [PATCH] 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 --- django/core/management.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/django/core/management.py b/django/core/management.py index eed6686ed1..4627b497ba 100644 --- a/django/core/management.py +++ b/django/core/management.py @@ -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)