1. Michael Hall
  2. django-extauth

Commits

Michael Hall  committed 6efec03

Remove references to o9

  • Participants
  • Parent commits c651352
  • Branches default

Comments (0)

Files changed (2)

File extauth/management/__init__.py

View file
         
 def _get_all_permissions(klass):
     "Returns (codename, name) for all permissions in the given opts."
-    from o9 import permissions
+    from extauth import permissions
     perms = [('read_%s' % klass._meta.object_name.lower(), u'Can read %s' % klass._meta.verbose_name_raw),]
     for field in klass._meta.fields + klass._meta.many_to_many:
         if field.name != 'id':
     return perms
 
 signals.post_syncdb.connect(create_model_permissions,
-    dispatch_uid = "o9.management.create_model_permissions")
+    dispatch_uid = "extauth.management.create_model_permissions")
 
-def create_page_permissions(app, created_models, verbosity, **kwargs):
-    from django.contrib.contenttypes.models import ContentType
-    from django.contrib.auth.models import Permission
-    from django.contrib.sites.models import Site
-    from o9 import sites
-    
-    ctype = ContentType.objects.get_for_model(Site)
-    
-    for s in sites.managed_sites:
-        if hasattr(s.Meta, 'permissions') and isinstance(s.Meta.permissions, (list, tuple)):
-            for (codename, name) in s.Meta.permissions:
-                p, created = Permission.objects.get_or_create(codename=codename, content_type__pk=ctype.id,
-                    defaults={'name': name, 'content_type': ctype})
-                if created and verbosity >= 2:
-                    print "Adding permission '%s'" % p            
 
-signals.post_syncdb.connect(create_page_permissions,
-    dispatch_uid = "o9.management.create_page_permissions")
-

File extauth/management/commands/updateperms.py

View file
 @author: Michael Hall <mhall119@gmail.com>
 '''
 from django.core.management.base import NoArgsCommand, CommandError
-from o9.management import create_model_permissions, create_page_permissions
+from extauth.management import create_model_permissions, create_page_permissions
 from django.contrib.auth.management import create_permissions
 from django.db.models import get_app, get_apps
 from django.conf import settings
             create_permissions(app, [], verbosity, **options)
             
             if verbosity >= 1:
-                print "Creating O9 model permissions"
+                print "Creating ExtAuth model permissions"
             create_model_permissions(app, [], verbosity, **options)
             
             if verbosity >= 1:
-                print "Creating O9 page permissions"
+                print "Creating ExtAuth page permissions"
             create_page_permissions(app, [], verbosity, **options)