Skip to content

Commit

Permalink
#37 lower logging level on legitimate cases
Browse files Browse the repository at this point in the history
  • Loading branch information
llybin committed Sep 11, 2024
1 parent 032ebd9 commit 7c30aaa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drf_recaptcha/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,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
)
raise ValidationError(self.messages["captcha_invalid"], code="captcha_invalid")
Expand Down Expand Up @@ -132,7 +132,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,
Expand All @@ -143,7 +143,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,
Expand Down

0 comments on commit 7c30aaa

Please sign in to comment.