Bugfix
This commit is contained in:
parent
f28e1cec30
commit
97ae472d2e
1 changed files with 1 additions and 0 deletions
|
@ -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'])
|
||||||
|
|
Loading…
Reference in a new issue