2017-02-22 20:00:32 +01:00
|
|
|
from django.apps import AppConfig
|
2017-06-24 21:57:27 +02:00
|
|
|
from django.db.models.signals import post_migrate
|
|
|
|
|
2017-09-05 15:02:33 +02:00
|
|
|
from gestion.apps import setup_assoc_perms
|
2017-02-22 20:00:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
class BDSConfig(AppConfig):
|
|
|
|
name = "bds"
|
|
|
|
verbose_name = "Application de gestion du BDS"
|
2017-06-24 21:57:27 +02:00
|
|
|
|
2017-09-05 15:02:33 +02:00
|
|
|
|
|
|
|
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'])
|
|
|
|
|
|
|
|
# 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)
|