1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-06-03 01:28:06 +02:00

implementing renaming entry

This commit is contained in:
kakwa 2015-07-28 00:18:05 +02:00
parent ac0a3473f7
commit e3fe0b4bfb

View File

@ -289,6 +289,13 @@ class Backend(ldapcherry.backend.Backend):
content = self._str(attrs[attr])
attr = self._str(attr)
new = {attr: content}
# if attr is dn entry, use rename
if attr.lower() == self.dn_user_attr.lower():
ldap_client.rename_s(
dn,
ldap.dn.dn2str([[(attr, content, 1)]])
)
else:
if attr in old_attrs:
old = {attr: old_attrs[attr]}
else: