From 82fdef16f1bc4ab0ead0e6e16ce6b11ba8b6d5cf Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Thu, 25 Sep 2025 16:20:07 +0800 Subject: [PATCH] feat: enable captcha requirement based on max attempts configuration --- apps/users/serializers/login.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/users/serializers/login.py b/apps/users/serializers/login.py index ebaff7345..e5487f137 100644 --- a/apps/users/serializers/login.py +++ b/apps/users/serializers/login.py @@ -143,7 +143,7 @@ class CaptchaSerializer(serializers.Serializer): auth_setting = LoginSerializer.get_auth_setting() max_attempts = auth_setting.get("max_attempts", 1) - need_captcha = False + need_captcha = True if max_attempts == -1: need_captcha = False elif max_attempts > 0: @@ -164,7 +164,7 @@ class CaptchaSerializer(serializers.Serializer): auth_setting = application_access_token.authentication_value max_attempts = auth_setting.get("max_attempts", 1) - need_captcha = False + need_captcha = True if max_attempts == -1: need_captcha = False elif max_attempts > 0: