Ticket #7077: set_default_user_as_admin_if_getpwuid_fails.patch
File set_default_user_as_admin_if_getpwuid_fails.patch, 571 bytes (added by , 17 years ago) |
---|
-
contrib/auth/create_superuser.py
25 25 default_username = '' 26 26 else: 27 27 # Determine the current system user's username, to use as a default. 28 default_username = pwd.getpwuid(os.getuid())[0].replace(' ', '').lower() 28 try: 29 default_username = pwd.getpwuid(os.getuid())[0].replace(' ', '').lower() 30 except: 31 default_username = 'admin' 29 32 30 33 # Determine whether the default username is taken, so we don't display 31 34 # it as an option.