Ticket #7431: windows-superuser.diff
File windows-superuser.diff, 1.0 KB (added by , 16 years ago) |
---|
-
contrib/auth/management/commands/createsuperuser.py
46 46 password = '' 47 47 48 48 # Try to determine the current system user's username to use as a default. 49 try: 50 import pwd 51 except ImportError: 52 default_username = '' 53 else: 54 default_username = pwd.getpwuid(os.getuid())[0].replace(' ', '').lower() 49 default_username = os.path.expanduser("~").replace(' ', '').lower().split(os.sep)[-1] 55 50 56 51 # Determine whether the default username is taken, so we don't display 57 52 # it as an option. … … 67 62 # try/except to trap for a keyboard interrupt and exit gracefully. 68 63 if interactive: 69 64 try: 70 65 71 66 # Get a username 72 67 while 1: 73 68 if not username: