replace PASSERELLE_APPS with PASSERELLE_APP_<APP_LABEL>_ENABLED (#8411)

This commit is contained in:
Thomas NOËL 2015-10-03 19:53:57 +02:00
parent 5e53c3902f
commit 2bcf6c2079
8 changed files with 20 additions and 11 deletions

View File

@ -92,7 +92,7 @@ class BaseResource(models.Model):
# get_icon_class won't be necessary anymore.
if not hasattr(cls, 'get_icon_class'):
return False
return cls._meta.app_label in settings.PASSERELLE_APPS
return getattr(settings, 'PASSERELLE_APP_%s_ENABLED' % cls._meta.app_label.upper(), False)
class AccessRight(models.Model):

View File

@ -8,5 +8,4 @@ Add to your settings.py
# local_settings.py:
INSTALLED_APPS += ('passerelle.contrib.agoraplus',)
PASSERELLE_APPS += ('agoraplus',)
PASSERELLE_APP_AGORAPLUS_ENABLED = True

View File

@ -5,5 +5,5 @@ Add to your settings.py:
# local_settings.py:
INSTALLED_APPS += ('passerelle.contrib.fake_family',)
PASSERELLE_APPS += ('fake_family',)
PASSERELLE_APP_FAKE_FAMILY_ENABLED = True

View File

@ -13,5 +13,4 @@ How to use
# local_settings.py:
INSTALLED_APPS += ('passerelle.contrib.maarch',)
PASSERELLE_APPS += ('maarch',)
PASSERELLE_APP_MAARCH_ENABLED = True

View File

@ -10,5 +10,5 @@ How to use
# local_settings.py:
INSTALLED_APPS += ('passerelle.contrib.teamnet_axel',)
PASSERELLE_APPS += ('teamnet_axel',)
PASSERELLE_APP_TEAMNET_AXEL_ENABLED = True

View File

@ -116,7 +116,18 @@ INSTALLED_APPS = (
)
# active applications
PASSERELLE_APPS = INSTALLED_APPS
PASSERELLE_APP_CLICRDV_ENABLED = True
PASSERELLE_APP_BASE_ADRESSE_ENABLED = True
PASSERELLE_APP_CSVDATASOURCE_ENABLED = True
PASSERELLE_APP_CHOOSIT_ENABLED = True
PASSERELLE_APP_OXYD_ENABLED = True
PASSERELLE_APP_OVH_ENABLED = True
PASSERELLE_APP_MOBYT_ENABLED = True
PASSERELLE_APP_BDP_ENABLED = False
PASSERELLE_APP_GDC_ENABLED = False
PASSERELLE_APP_PASTELL_ENABLED = False
PASSERELLE_APP_CONCERTO_ENABLED = False
# Authentication settings
try:

View File

@ -54,9 +54,9 @@ def unless(test, message):
return decorator
def app_enabled(app_label):
'''for enabling a view based on its status in PASSERELLE_APPS'''
'''for enabling a view based on PASSERELLE_APP_<APP_LABEL>_ENABLED flag'''
def test():
return app_label in settings.PASSERELLE_APPS
return getattr(settings, 'PASSERELLE_APP_%s_ENABLED' % app_label.upper(), False)
return unless(test, 'please enable %s' % app_label)
def setting_enabled(name):

View File

@ -1,4 +1,4 @@
LANGUAGE_CODE = 'en-us'
INSTALLED_APPS += ('passerelle.contrib.fake_family',)
PASSERELLE_APPS += ('fake_family',)
PASSERELLE_APP_FAKE_FAMILY_ENABLED = True