summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2018-03-07 15:54:19 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2018-03-07 15:54:19 (GMT)
commitb66a974922031728fbdbcb2683ed3fdf13ec47c4 (patch)
tree218c636718196fb0e8c4f625d56c2b505e65059d
parentac75dce84f5bd029d00f5a7d96d9d9d7d773acd0 (diff)
downloaddjango-mellon-b66a974922031728fbdbcb2683ed3fdf13ec47c4.zip
django-mellon-b66a974922031728fbdbcb2683ed3fdf13ec47c4.tar.gz
django-mellon-b66a974922031728fbdbcb2683ed3fdf13ec47c4.tar.bz2
do not raise ImproperlyConfigured on acces to app_settings.IDENTITY_PROVIDERS (fixes #20221)
-rw-r--r--mellon/adapters.py3
-rw-r--r--mellon/app_settings.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/mellon/adapters.py b/mellon/adapters.py
index bbf56e1..a4dff9d 100644
--- a/mellon/adapters.py
+++ b/mellon/adapters.py
@@ -28,6 +28,9 @@ class DefaultAdapter(object):
return idp
def get_identity_providers_setting(self):
+ if not app_settings.IDENTITY_PROVIDERS:
+ from django.core.exceptions import ImproperlyConfigured
+ raise ImproperlyConfigured('The MELLON_IDENTITY_PROVIDERS setting is mandatory')
return app_settings.IDENTITY_PROVIDERS
def get_idps(self):
diff --git a/mellon/app_settings.py b/mellon/app_settings.py
index b948a2f..131ba9c 100644
--- a/mellon/app_settings.py
+++ b/mellon/app_settings.py
@@ -45,8 +45,7 @@ class AppSettings(object):
try:
idps = settings.MELLON_IDENTITY_PROVIDERS
except AttributeError:
- from django.core.exceptions import ImproperlyConfigured
- raise ImproperlyConfigured('The MELLON_IDENTITY_PROVIDERS setting is mandatory')
+ return []
if isinstance(idps, dict):
idps = [idps]
return idps