ezldap: use ignore_errors in EzMagicUser.get()
This commit is contained in:
parent
287d436547
commit
2306a1fca8
|
@ -177,6 +177,8 @@ class EzMagicUser(User):
|
|||
# perhaps add a little cache ? (ttl 5 min ?)
|
||||
get_ldap_conn().search_s(str(id), ldap.SCOPE_BASE)
|
||||
except ldap.NO_SUCH_OBJECT:
|
||||
if ignore_errors:
|
||||
return None
|
||||
raise KeyError
|
||||
return EzLdapUser(id)
|
||||
else:
|
||||
|
|
Reference in New Issue