Do not fail silently when ldap_config yields an ImportError itself

This commit is contained in:
Jakob Haufe 2020-05-19 15:41:53 +02:00
parent cd236aa886
commit 7494e2999b
No known key found for this signature in database
GPG Key ID: 07C6102015375A3B

View File

@ -382,8 +382,11 @@ CSRF_TRUSTED_ORIGINS = ALLOWED_HOSTS
try:
from netbox import ldap_config as LDAP_CONFIG
except ImportError:
LDAP_CONFIG = None
except ImportError as ie:
if ie.name == 'netbox':
LDAP_CONFIG = None
else:
raise ie
if LDAP_CONFIG is not None: