Ticket #9057: 9057.2.patch
File 9057.2.patch, 1.2 KB (added by , 16 years ago) |
---|
-
django/contrib/auth/management/__init__.py
a b Creates permissions for all installed apps that need permissions. 4 4 5 5 from django.db.models import get_models, signals 6 6 from django.contrib.auth import models as auth_app 7 from django.conf import settings 7 8 8 9 def _get_permission_codename(action, opts): 9 10 return u'%s_%s' % (action, opts.object_name.lower()) … … def create_superuser(app, created_models, verbosity, **kwargs): 44 45 call_command("createsuperuser", interactive=True) 45 46 break 46 47 47 signals.post_syncdb.connect(create_permissions, 48 dispatch_uid = "django.contrib.auth.management.create_permissions") 49 signals.post_syncdb.connect(create_superuser, 50 sender=auth_app, dispatch_uid = "django.contrib.auth.management.create_superuser") 48 if settings.AUTH_AUTO_CREATE_PERMISSIONS: 49 signals.post_syncdb.connect(create_permissions, 50 dispatch_uid = "django.contrib.auth.management.create_permissions") 51 if settings.AUTH_AUTO_CREATE_SUPERUSER: 52 signals.post_syncdb.connect(create_superuser, 53 sender=auth_app, dispatch_uid = "django.contrib.auth.management.create_superuser")