gestioCOF/cof/apps.py

23 lines
666 B
Python
Raw Normal View History

2017-02-22 20:00:32 +01:00
from django.apps import AppConfig
from django.db.models.signals import post_migrate
from gestion.apps import setup_assoc_perms
2017-02-22 20:00:32 +01:00
class COFConfig(AppConfig):
name = "cof"
verbose_name = "Application de gestion du COF"
def setup_cof_perms(sender, apps, **kwargs):
from cof.models import get_cof_assoc
2017-09-09 15:55:22 +02:00
setup_assoc_perms(
apps, get_cof_assoc,
buro_of_apps=['gestion', 'cof'],
perms=["custommail.add_custommail", "custommail.change_custommail"]
)
# Setup permissions of defaults groups of BDS association after Permission
# instances have been created, i.e. after applying migrations.
post_migrate.connect(setup_cof_perms)