Browse Source

Bugfix

export_seznamu_prednasek
parent
commit
97ae472d2e
  1. 1
      seminar/management/commands/load_org_permissions.py

1
seminar/management/commands/load_org_permissions.py

@ -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…
Cancel
Save