From b6269333359f05cbfba708af076a23a309788212 Mon Sep 17 00:00:00 2001 From: Bai Date: Fri, 8 May 2026 16:18:13 +0800 Subject: [PATCH] fix: account history count keep issue --- apps/accounts/tasks/remove_account.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/accounts/tasks/remove_account.py b/apps/accounts/tasks/remove_account.py index bbd7821c7..7b46d447b 100644 --- a/apps/accounts/tasks/remove_account.py +++ b/apps/accounts/tasks/remove_account.py @@ -63,6 +63,8 @@ def clean_historical_accounts(): if settings.HISTORY_ACCOUNT_CLEAN_LIMIT >= 999: return limit = settings.HISTORY_ACCOUNT_CLEAN_LIMIT + limit += 1 # 因为当前账号的密码是最新的那条历史记录,因此保留 n 条历史,实际上应该保留 n+1 条历史记录 + history_ids_to_be_deleted = [] history_model = Account.history.model