This commit is contained in:
Tomas 'Jethro' Pokorny 2021-03-16 21:38:07 +01:00
parent f28e1cec30
commit 97ae472d2e

View file

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