perf: Login to change password and filter out useless accounts

This commit is contained in:
feng 2025-06-11 19:13:07 +08:00
parent 79c2284a01
commit 939c7b214e

View File

@ -110,6 +110,13 @@ class SessionSerializer(BulkOrgResourceModelSerializer):
except Account.DoesNotExist:
logger.warning(f"Account with id {account_id} does not exist for change secret task.")
return
if not account.secret_reset or not account.is_active:
logger.warning(
f"Account secret reset is not enabled or account is inactive: account={account}"
)
return
acls = LoginAssetACL.filter_queryset(**kwargs)
acl = LoginAssetACL.get_match_rule_acls(user, instance.remote_addr, acls)
if not acl: