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
|
"Synced User", user=ak_user.username, created=created
|
||||||
)
|
)
|
||||||
user_count += 1
|
user_count += 1
|
||||||
# pylint: disable=no-value-for-parameter
|
pwd_last_set: datetime = attributes.get("pwdLastSet", datetime.now())
|
||||||
pwd_last_set = UTC.localize(
|
pwd_last_set = pwd_last_set.replace(tzinfo=UTC)
|
||||||
attributes.get("pwdLastSet", datetime.now())
|
|
||||||
)
|
|
||||||
if created or pwd_last_set >= ak_user.password_change_date:
|
if created or pwd_last_set >= ak_user.password_change_date:
|
||||||
self._logger.debug(
|
self._logger.debug(
|
||||||
"Reset user's password",
|
"Reset user's password",
|
||||||
|
|
Reference in New Issue