forked from Github-Mirrors/canaille
LDAPUtils.get catches the ldap errors
This commit is contained in:
parent
6b4585c5fa
commit
aaa6cacfa2
1 changed files with 4 additions and 1 deletions
|
@ -196,7 +196,10 @@ class LDAPObject:
|
|||
elif "=" not in dn:
|
||||
dn = f"{cls.id}={dn},{cls.base},{cls.root_dn}"
|
||||
|
||||
try:
|
||||
result = conn.search_s(dn, ldap.SCOPE_SUBTREE, filter)
|
||||
except ldap.LDAPError:
|
||||
result = None
|
||||
|
||||
if not result:
|
||||
return None
|
||||
|
|
Loading…
Reference in a new issue