From 264eeaf14adf979a81439c6d1f6a8a53b088885e Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 31 Jul 2015 07:48:03 -0400 Subject: [PATCH] Removed unnecessary if statement in createsuperuser command. --- .../auth/management/commands/createsuperuser.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/django/contrib/auth/management/commands/createsuperuser.py b/django/contrib/auth/management/commands/createsuperuser.py index 1e3b9a8d7c..ae6ea0e48a 100644 --- a/django/contrib/auth/management/commands/createsuperuser.py +++ b/django/contrib/auth/management/commands/createsuperuser.py @@ -125,13 +125,13 @@ class Command(BaseCommand): # Get a password while password is None: - if not password: - password = getpass.getpass() - password2 = getpass.getpass(force_str('Password (again): ')) - if password != password2: - self.stderr.write("Error: Your passwords didn't match.") - password = None - continue + password = getpass.getpass() + password2 = getpass.getpass(force_str('Password (again): ')) + if password != password2: + self.stderr.write("Error: Your passwords didn't match.") + password = None + continue + if password.strip() == '': self.stderr.write("Error: Blank passwords aren't allowed.") password = None