forked from DGNum/gestioCOF
29d288c567
- 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.
17 lines
493 B
Python
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)
|