From bf5ba98ab8da021e861ad20fcd949fd063b3fcb7 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Tue, 21 Dec 2021 09:58:05 +0100 Subject: [PATCH] helpers.ldap.connect(): raise LDAPException for every non-zero result --- ldap_frontend/helpers/ldap.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ldap_frontend/helpers/ldap.py b/ldap_frontend/helpers/ldap.py index 0c5fa73..f3e8db2 100644 --- a/ldap_frontend/helpers/ldap.py +++ b/ldap_frontend/helpers/ldap.py @@ -83,6 +83,9 @@ def connect(user=None, password=None): ) conn.bind() + if conn.result["result"] != 0: + raise LDAPException(conn.result["description"]) + return conn