Browse Source

Valid password input in createsuperuser

Rafał Pitoń 11 years ago
parent
commit
5914066529
1 changed files with 3 additions and 2 deletions
  1. 3 2
      misago/users/management/commands/createsuperuser.py

+ 3 - 2
misago/users/management/commands/createsuperuser.py

@@ -2,6 +2,7 @@
 Misago-native rehash of Django's createsuperuser command that
 Misago-native rehash of Django's createsuperuser command that
 works with double authentication fields on user model
 works with double authentication fields on user model
 """
 """
+from getpass import getpass
 from optparse import make_option
 from optparse import make_option
 import sys
 import sys
 from django.contrib.auth import get_user_model
 from django.contrib.auth import get_user_model
@@ -112,9 +113,9 @@ class Command(BaseCommand):
 
 
                 while not password:
                 while not password:
                     try:
                     try:
-                        raw_value = input("Enter password: ").strip()
+                        raw_value = getpass("Enter password: ").strip()
                         validate_password(raw_value)
                         validate_password(raw_value)
-                        repeat_raw_value = input("Repeat password: ").strip()
+                        repeat_raw_value = getpass("Repeat password: ").strip()
                         if raw_value != repeat_raw_value:
                         if raw_value != repeat_raw_value:
                             raise ValidationError(
                             raise ValidationError(
                                 "Entered passwords are different.")
                                 "Entered passwords are different.")