forked from DGNum/gestioCOF
- Permissions of 'gestion' app are correctly added to the staff groups of associations. - Add tests to ensure staff groups of COF and BDS are correctly setup. - Shortcut functions are added to retrieve COF and BDS association.
19 lines
567 B
Python
19 lines
567 B
Python
from django.apps import AppConfig
|
|
from django.db.models.signals import post_migrate
|
|
|
|
from gestion.apps import setup_assoc_perms
|
|
|
|
|
|
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
|
|
setup_assoc_perms(apps, get_cof_assoc, buro_of_apps=['gestion', 'cof'])
|
|
|
|
# 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)
|