From 42d57e7b424729798760298e57f6ceb51035d54e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Tue, 3 Dec 2024 22:19:40 +0100 Subject: [PATCH] =?UTF-8?q?P=C5=99eb=C3=BDvaj=C3=ADc=C3=AD=20dump=20pr?= =?UTF-8?q?=C3=A1v?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commands/save_org_permissions.py | 20 ------------------- 1 file changed, 20 deletions(-) delete mode 100644 various/management/commands/save_org_permissions.py diff --git a/various/management/commands/save_org_permissions.py b/various/management/commands/save_org_permissions.py deleted file mode 100644 index 216f9e4b..00000000 --- a/various/management/commands/save_org_permissions.py +++ /dev/null @@ -1,20 +0,0 @@ -from django.core.management.base import BaseCommand -from django.contrib.sessions.models import Session -from django.contrib.auth.models import Group, Permission -import json - -class Command(BaseCommand): - """ - Dump permissions for group 'org' such that them can be used on an other machine. - - """ - def handle(self, *args, **options): - orgroup = Group.objects.get(name='org') - permissions = [] - for p in orgroup.permissions.all(): - permissions.append({ - 'codename': p.codename, - 'ct_app_label': p.content_type.app_label, - 'ct_model': p.content_type.model}) - print(json.dumps(permissions)) -