From f15dcf2f419db79fa2350cdebd761afb21c4d97b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Mon, 31 Jan 2022 20:10:23 +0100 Subject: [PATCH] =?UTF-8?q?Migrace=20p=C5=99id=C3=A1vaj=C3=ADc=C3=AD=20sku?= =?UTF-8?q?piny=20org=20a=20resitel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- personalni/migrations/0001_skupiny.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 personalni/migrations/0001_skupiny.py diff --git a/personalni/migrations/0001_skupiny.py b/personalni/migrations/0001_skupiny.py new file mode 100644 index 00000000..b35a5ed5 --- /dev/null +++ b/personalni/migrations/0001_skupiny.py @@ -0,0 +1,23 @@ +from django.db import migrations + + +def add_groups(apps, schema_editor): + Group = apps.get_model('auth', 'Group') + + org_group = Group.objects.filter(name__exact='org').first() + if not org_group: + Group.objects.create(name='org') + resitel_group = Group.objects.filter(name__exact='resitel').first() + if not resitel_group: + Group.objects.create(name='resitel') + + +class Migration(migrations.Migration): + + dependencies = [ + ('seminar', '0001_initial'), + ] + + operations = [ + migrations.RunPython(add_groups, migrations.RunPython.noop), + ]