chore: added logs to debug captcha issues (#37066)

This commit is contained in:
Ahtisham Shahid
2025-07-25 00:45:40 +05:00
committed by GitHub
parent faad8bf020
commit 47d253a1fe

View File

@@ -1,6 +1,7 @@
"""
Utils for discussion API.
"""
import logging
from datetime import datetime
from typing import Dict, List
@@ -26,6 +27,8 @@ from openedx.core.djangoapps.django_comment_common.models import (
Role
)
log = logging.getLogger(__name__)
class AttributeDict(dict):
"""
@@ -422,8 +425,10 @@ def verify_recaptcha_token(token):
try:
response = requests.post(verify_url, data=verify_data, timeout=10)
result = response.json()
log.info("reCAPTCHA verification result: %s", result)
return result.get('success', False)
except: # pylint: disable=bare-except
except Exception as e: # pylint: disable=broad-except
log.error("Error verifying reCAPTCHA token: %s", e)
return False