Ticket #3165: createsuperuser.patch
File createsuperuser.patch, 939 bytes (added by , 18 years ago) |
---|
-
django/contrib/auth/create_superuser.py
10 10 import getpass 11 11 import os 12 12 import sys 13 import re 13 14 15 RE_VALID_USERNAME = re.compile('\w+$') 16 14 17 def createsuperuser(username=None, email=None, password=None): 15 18 """ 16 19 Helper function for creating a superuser from the command line. All … … 43 46 username = raw_input(input_msg + ': ') 44 47 if default_username and username == '': 45 48 username = default_username 46 if not username.isalnum():49 if not RE_VALID_USERNAME.match(username): 47 50 sys.stderr.write("Error: That username is invalid. Use only letters, digits and underscores.\n") 48 51 username = None 49 52 continue