2017-02-22 20:00:32 +01:00
|
|
|
from django.apps import AppConfig
|
|
|
|
|
|
|
|
|
|
|
|
class GestionConfig(AppConfig):
|
|
|
|
name = "gestion"
|
|
|
|
verbose_name = "Gestion des outils communs COF/BDS"
|
2017-09-05 15:02:33 +02:00
|
|
|
|
|
|
|
|
2017-09-09 15:55:22 +02:00
|
|
|
def setup_assoc_perms(apps, assoc_getter, buro_of_apps=[], perms=[]):
|
2017-09-05 15:02:33 +02:00
|
|
|
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
|
2017-09-09 15:55:22 +02:00
|
|
|
assoc_getter().setup_perms(buro_of_apps=buro_of_apps, perms=perms)
|