app_settings,utils: move IDP_BACENDS default value into app_settings

This commit is contained in:
Benjamin Dauvergne 2014-03-21 12:30:36 +01:00
parent 5594936854
commit b72dc3a488
2 changed files with 3 additions and 3 deletions

View File

@ -76,6 +76,7 @@ default_settings = dict(
A2_REGISTRATION_FORM_USERNAME_HELP_TEXT=Setting(default=_('Required. At most '
'30 characters. Letters, digits, and @/./+/-/_ only.')),
A2_REGISTRATION_FORM_USERNAME_LABEL=Setting(default=_('Username')),
IDP_BACKENDS=[],
)
app_settings = AppSettings(default_settings)

View File

@ -14,8 +14,7 @@ from django.core.exceptions import ImproperlyConfigured
from authentic2.saml.saml2utils import filter_attribute_private_key, \
filter_element_private_key
from . import plugins
from . import plugins, app_settings
class CleanLogMessage(logging.Filter):
def filter(self, record):
@ -170,7 +169,7 @@ def load_backend(path):
def get_backends(setting_name='IDP_BACKENDS'):
'''Return the list of IdP backends'''
backends = []
for backend_path in getattr(settings, setting_name, ()):
for backend_path in getattr(app_settings, setting_name, ()):
backends.append(load_backend(backend_path))
return backends