sources/ldap: fix password setter on users which are not LDAP

This commit is contained in:
Jens Langhammer 2021-02-27 16:49:59 +01:00
parent 92943f08d9
commit 4cbfaaa72b
1 changed files with 2 additions and 1 deletions

View File

@ -77,7 +77,8 @@ class LDAPPasswordChanger:
"""Change user's password""" """Change user's password"""
user_dn = user.attributes.get(LDAP_DISTINGUISHED_NAME, None) user_dn = user.attributes.get(LDAP_DISTINGUISHED_NAME, None)
if not user_dn: if not user_dn:
raise AttributeError(f"User has no {LDAP_DISTINGUISHED_NAME} set.") LOGGER.info(f"User has no {LDAP_DISTINGUISHED_NAME} set.")
return
self._source.connection.extend.microsoft.modify_password(user_dn, password) self._source.connection.extend.microsoft.modify_password(user_dn, password)
def _ad_check_password_existing(self, password: str, user_dn: str) -> bool: def _ad_check_password_existing(self, password: str, user_dn: str) -> bool: