From ae5c857c749f1ce79e0dd405a142227cdb7bf647 Mon Sep 17 00:00:00 2001 From: kakwa Date: Sun, 28 Jun 2015 23:33:37 +0200 Subject: [PATCH] fix error if password is not in modified attributes --- ldapcherry/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ldapcherry/__init__.py b/ldapcherry/__init__.py index 8305a8d..4f42331 100644 --- a/ldapcherry/__init__.py +++ b/ldapcherry/__init__.py @@ -542,9 +542,10 @@ class LdapCherry(object): if self.attributes.attributes[attr]['type'] == 'password': pwd1 = attr + '1' pwd2 = attr + '2' - if params['attrs'][pwd1] != params['attrs'][pwd2]: - raise Exception() - params['attrs'][attr] = params['attrs'][pwd1] + if pwd1 in params['attrs']: + if params['attrs'][pwd1] != params['attrs'][pwd2]: + raise Exception() + params['attrs'][attr] = params['attrs'][pwd1] if attr in params['attrs']: backends = self.attributes.get_backends_attributes(attr) for b in backends: