Ticket #9444: anonuser.management.__init__.patch
File anonuser.management.__init__.patch, 1.5 KB (added by , 16 years ago) |
---|
-
\django\contrib\auth\management\__init__.py
old new 43 43 if confirm == 'yes': 44 44 call_command("createsuperuser", interactive=True) 45 45 break 46 47 def create_anonuser(app, created_models, verbosity, **kwargs): 48 from django.contrib.auth.models import User 49 from django.core.management import call_command 50 if User in created_models and kwargs.get('interactive', True): 51 msg = "\nYou just installed Django's auth system, which means you don't have " \ 52 "an anonymous user defined.\nWould you like to create one now? (yes/no): " 53 confirm = raw_input(msg) 54 while 1: 55 if confirm not in ('yes', 'no'): 56 confirm = raw_input('Please enter either "yes" or "no": ') 57 continue 58 if confirm == 'yes': 59 call_command("createanonuser", interactive=False) 60 break 46 61 47 62 signals.post_syncdb.connect(create_permissions, 48 63 dispatch_uid = "django.contrib.auth.management.create_permissions") 64 signals.post_syncdb.connect(create_anonuser, 65 sender=auth_app, dispatch_uid = "django.contrib.auth.management.create_anonuser") 49 66 signals.post_syncdb.connect(create_superuser, 50 67 sender=auth_app, dispatch_uid = "django.contrib.auth.management.create_superuser")