gestioCOF/bds/apps.py
2017-09-09 15:55:22 +02:00

22 lines
666 B
Python

from django.apps import AppConfig
from django.db.models.signals import post_migrate
from gestion.apps import setup_assoc_perms
class BDSConfig(AppConfig):
name = "bds"
verbose_name = "Application de gestion du BDS"
def setup_bds_perms(sender, apps, **kwargs):
from bds.models import get_bds_assoc
setup_assoc_perms(
apps, get_bds_assoc,
buro_of_apps=['gestion', 'bds'],
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_bds_perms)