fix: password_expired account, not listed as risk account

pull/15067/head
wangruidong 2025-03-18 19:18:13 +08:00 committed by w940853815
parent 325edfe704
commit e5f66c4be2
1 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,7 @@
from django.utils import timezone
from datetime import datetime from datetime import datetime
from django.utils import timezone
__all__ = ['GatherAccountsFilter'] __all__ = ['GatherAccountsFilter']
@ -180,9 +181,9 @@ class GatherAccountsFilter:
start_date = timezone.make_aware(timezone.datetime(1970, 1, 1)) start_date = timezone.make_aware(timezone.datetime(1970, 1, 1))
_password_date = username_password_date.get(username) or '' _password_date = username_password_date.get(username) or ''
if _password_date and len(_password_date) == 2: 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])) 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])) user['date_password_expired'] = start_date + timezone.timedelta(days=int(_password_date[1]))
detail = { detail = {
'groups': username_groups.get(username) or '', 'groups': username_groups.get(username) or '',