OpenSlides/server/openslides/saml/__init__.py

18 lines
415 B
Python
Raw Normal View History

2019-08-20 12:00:54 +02:00
from django.conf import settings
from .exceptions import SamlException
default_app_config = "openslides.saml.apps.SamlAppConfig"
SAML_ENABLED = getattr(settings, "ENABLE_SAML", False)
if SAML_ENABLED:
try:
import onelogin.saml2 # noqa
except ImportError:
raise SamlException(
"SAML is enabled, but we could not import onelogin.saml2. Is python3-saml installed?"
)