From 2536f0c24d52e01def67a3aa8707c1863be7c25b Mon Sep 17 00:00:00 2001 From: Lev Lybin Date: Wed, 11 Sep 2024 19:36:02 +0700 Subject: [PATCH] #37 lower logging level on legitimate cases (#39) --- drf_recaptcha/validators.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drf_recaptcha/validators.py b/drf_recaptcha/validators.py index 446457e..1b1bc86 100644 --- a/drf_recaptcha/validators.py +++ b/drf_recaptcha/validators.py @@ -96,7 +96,7 @@ def _pre_validate_response(self, check_captcha: "RecaptchaResponse") -> None: if check_captcha.is_valid: return - logger.error( + logger.info( "ReCAPTCHA validation failed due to: %s", check_captcha.error_codes, ) @@ -139,7 +139,7 @@ def _process_response(self, check_captcha_response): action = check_captcha_response.extra_data.get("action", "") if self.recaptcha_required_score > float(self.score): - logger.error( + logger.info( "ReCAPTCHA validation failed due to score of %s" " being lower than the required amount for action '%s'.", self.score, @@ -151,7 +151,7 @@ def _process_response(self, check_captcha_response): ) if self.recaptcha_action != action: - logger.error( + logger.warning( "ReCAPTCHA validation failed due to value of action '%s'" " is not equal with defined '%s'.", action,