gestioCOF/bds/migrations/0002_add_BDS_groups.py

36 lines
926 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def create_groups(apps, schema_editor):
"""
Creates the groups for BDS members and staff
"""
Group = apps.get_model("auth", "Group")
Group.objects.get_or_create(name="bds_members")
Group.objects.get_or_create(name="bds_buro")
class Migration(migrations.Migration):
dependencies = [
('bds', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='bdsprofile',
options={
'permissions': [
('member', 'Is a BDS member'),
('buro', 'Is part of the BDS staff')
],
'verbose_name': 'Profil BDS',
'verbose_name_plural': 'Profils BDS'
},
),
migrations.RunPython(create_groups, migrations.RunPython.noop),
]