kpsul/gestion/apps.py
Aurélien Delobelle 29d288c567 Fix permissions setup of associations.
- 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.
2017-09-05 15:02:33 +02:00

17 lines
493 B
Python

from django.apps import AppConfig
class GestionConfig(AppConfig):
name = "gestion"
verbose_name = "Gestion des outils communs COF/BDS"
def setup_assoc_perms(apps, assoc_getter, buro_of_apps=[], **kwargs):
try:
# Association and Permission models are required to be ready to setup
# perms.
apps.get_app_config('gestion')
apps.get_app_config('auth')
except LookupError:
return
assoc_getter().setup_perms(buro_of_apps=buro_of_apps)