|
@ -18,6 +18,7 @@ class Command(BaseCommand): |
|
|
def handle(self, *args, **options): |
|
|
def handle(self, *args, **options): |
|
|
orgroup = Group.objects.get(name='org') |
|
|
orgroup = Group.objects.get(name='org') |
|
|
permissions = json.load(options['file'][0]) |
|
|
permissions = json.load(options['file'][0]) |
|
|
|
|
|
orgroup.permissions.clear() |
|
|
for jp in permissions: |
|
|
for jp in permissions: |
|
|
ct = ContentType.objects.get(app_label = jp['ct_app_label'], model = jp['ct_model']) |
|
|
ct = ContentType.objects.get(app_label = jp['ct_app_label'], model = jp['ct_model']) |
|
|
perm = Permission.objects.get(content_type = ct, codename = jp['codename']) |
|
|
perm = Permission.objects.get(content_type = ct, codename = jp['codename']) |
|
|