From e5f66c4be2314cf12ea4543406ce40444fc870b5 Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Tue, 18 Mar 2025 19:18:13 +0800 Subject: [PATCH] fix: password_expired account, not listed as risk account --- apps/accounts/automations/gather_account/filter.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/accounts/automations/gather_account/filter.py b/apps/accounts/automations/gather_account/filter.py index 41bfc4938..a12b78586 100644 --- a/apps/accounts/automations/gather_account/filter.py +++ b/apps/accounts/automations/gather_account/filter.py @@ -1,6 +1,7 @@ -from django.utils import timezone from datetime import datetime +from django.utils import timezone + __all__ = ['GatherAccountsFilter'] @@ -180,9 +181,9 @@ class GatherAccountsFilter: start_date = timezone.make_aware(timezone.datetime(1970, 1, 1)) _password_date = username_password_date.get(username) or '' if _password_date and len(_password_date) == 2: - if _password_date[0] and _password_date[0] != '0': + if _password_date[0]: user['date_password_change'] = start_date + timezone.timedelta(days=int(_password_date[0])) - if _password_date[1] and _password_date[1] != '0': + if _password_date[1]: user['date_password_expired'] = start_date + timezone.timedelta(days=int(_password_date[1])) detail = { 'groups': username_groups.get(username) or '',