stages/password: catch importerror during authentic()

This commit is contained in:
Jens Langhammer 2021-01-17 20:18:45 +01:00
parent 4e884e80ab
commit 90220e911f

View file

@ -31,7 +31,11 @@ def authenticate(
Customized version of django's authenticate, which accepts a list of backends"""
for backend_path in backends:
try:
backend: BaseBackend = path_to_class(backend_path)()
except ImportError:
LOGGER.warning("Failed to import backend", path=backend_path)
continue
LOGGER.debug("Attempting authentication...", backend=backend)
user = backend.authenticate(request, **credentials)
if user is None: