From fa4d9476f24fd227a31f1b9a599d6eb2c1f93f6a Mon Sep 17 00:00:00 2001 From: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> Date: Wed, 29 Nov 2023 20:27:51 +0100 Subject: [PATCH] Upgraded django-recaptcha to 4.0.0. --- contact/forms.py | 4 ++-- djangoproject/settings/common.py | 2 +- djangoproject/settings/dev.py | 2 +- djangoproject/settings/docker.py | 2 +- djangoproject/settings/prod.py | 2 +- fundraising/forms.py | 4 ++-- requirements/common.txt | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/contact/forms.py b/contact/forms.py index 617b2fa83..ccdd056c2 100644 --- a/contact/forms.py +++ b/contact/forms.py @@ -1,13 +1,13 @@ import logging import django -from captcha.fields import ReCaptchaField -from captcha.widgets import ReCaptchaV3 from django import forms from django.conf import settings from django.contrib.sites.models import Site from django.utils.encoding import force_bytes from django_contact_form.forms import ContactForm +from django_recaptcha.fields import ReCaptchaField +from django_recaptcha.widgets import ReCaptchaV3 from pykismet3 import Akismet, AkismetServerError logger = logging.getLogger(__name__) diff --git a/djangoproject/settings/common.py b/djangoproject/settings/common.py index 2743aaf82..52f2b0605 100644 --- a/djangoproject/settings/common.py +++ b/djangoproject/settings/common.py @@ -70,7 +70,7 @@ "svntogit", "tracdb", "fundraising", - "captcha", + "django_recaptcha", "registration", "django_hosts", "sorl.thumbnail", diff --git a/djangoproject/settings/dev.py b/djangoproject/settings/dev.py index e652d3af9..788cf1836 100644 --- a/djangoproject/settings/dev.py +++ b/djangoproject/settings/dev.py @@ -63,4 +63,4 @@ "djangoproject.middleware.CORSMiddleware", ) -SILENCED_SYSTEM_CHECKS = ["captcha.recaptcha_test_key_error"] +SILENCED_SYSTEM_CHECKS = ["django_recaptcha.recaptcha_test_key_error"] diff --git a/djangoproject/settings/docker.py b/djangoproject/settings/docker.py index badee833c..d97f054e7 100644 --- a/djangoproject/settings/docker.py +++ b/djangoproject/settings/docker.py @@ -14,7 +14,7 @@ SECRET_KEY = os.environ.get("SECRET_KEY") SILENCED_SYSTEM_CHECKS = SILENCED_SYSTEM_CHECKS + [ - "captcha.recaptcha_test_key_error" # Default test keys for development. + "django_recaptcha.recaptcha_test_key_error" # Default test keys for development. ] ALLOWED_HOSTS = [".localhost", "127.0.0.1", "www.127.0.0.1"] diff --git a/djangoproject/settings/prod.py b/djangoproject/settings/prod.py index c5a7640c4..a0350ff44 100644 --- a/djangoproject/settings/prod.py +++ b/djangoproject/settings/prod.py @@ -86,7 +86,7 @@ ) # RECAPTCHA KEYS -# Defaults will trigger 'captcha.recaptcha_test_key_error' system check +# Defaults will trigger 'django_recaptcha.recaptcha_test_key_error' system check if "recaptcha_public_key" in SECRETS: RECAPTCHA_PUBLIC_KEY = SECRETS.get("recaptcha_public_key") RECAPTCHA_PRIVATE_KEY = SECRETS.get("recaptcha_private_key") diff --git a/fundraising/forms.py b/fundraising/forms.py index 915f10598..e757d4322 100644 --- a/fundraising/forms.py +++ b/fundraising/forms.py @@ -1,8 +1,8 @@ import stripe -from captcha.fields import ReCaptchaField -from captcha.widgets import ReCaptchaV3 from django import forms from django.utils.safestring import mark_safe +from django_recaptcha.fields import ReCaptchaField +from django_recaptcha.widgets import ReCaptchaV3 from .models import INTERVAL_CHOICES, LEADERSHIP_LEVEL_AMOUNT, DjangoHero, Donation diff --git a/requirements/common.txt b/requirements/common.txt index 8fa52e48c..fc7557d43 100644 --- a/requirements/common.txt +++ b/requirements/common.txt @@ -5,7 +5,7 @@ django-hosts==5.1 django-money==2.1.1 django-push==1.1 django-read-only==1.12.0 -django-recaptcha==3.0.0 +django-recaptcha==4.0.0 django-registration-redux==2.10 Django==3.2.20 docutils==0.17.1