ezldap: use ignore_errors in EzMagicUser.get()

This commit is contained in:
Thomas NOËL 2012-11-08 10:56:42 +01:00
parent 287d436547
commit 2306a1fca8
1 changed files with 2 additions and 0 deletions

View File

@ -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: