sources/ldap: fix sync for Users without pwdLastSet
This commit is contained in:
parent
ff5f5f65e8
commit
32655567da
|
@ -60,10 +60,8 @@ class UserLDAPSynchronizer(BaseLDAPSynchronizer):
|
|||
"Synced User", user=ak_user.username, created=created
|
||||
)
|
||||
user_count += 1
|
||||
# pylint: disable=no-value-for-parameter
|
||||
pwd_last_set = UTC.localize(
|
||||
attributes.get("pwdLastSet", datetime.now())
|
||||
)
|
||||
pwd_last_set: datetime = attributes.get("pwdLastSet", datetime.now())
|
||||
pwd_last_set = pwd_last_set.replace(tzinfo=UTC)
|
||||
if created or pwd_last_set >= ak_user.password_change_date:
|
||||
self._logger.debug(
|
||||
"Reset user's password",
|
||||
|
|
Reference in a new issue