proper exception in ldap backend

adding proper management of none existant user in group function
if user doesn't exist.
This commit is contained in:
kakwa 2016-08-01 19:57:51 +02:00
parent 0a4db74f1f
commit 5a45a24055
1 changed files with 2 additions and 0 deletions

View File

@ -442,6 +442,8 @@ class Backend(ldapcherry.backend.Backend):
# but with MOD_DELETE
ldap_client = self._bind()
tmp = self._get_user(self._str(username), ALL_ATTRS)
if tmp is None:
raise UserDoesntExist(username, self.backend_name)
dn = tmp[0]
attrs = tmp[1]
attrs['dn'] = dn