From 411bc8894eb063ec612c46b8cfd092ccd18f0964 Mon Sep 17 00:00:00 2001 From: Situphen Date: Sat, 13 Jan 2024 15:59:20 +0100 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20django=5Frecaptcha?= =?UTF-8?q?=20(#6570)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 2 +- zds/member/forms.py | 2 +- zds/settings/abstract_base/django.py | 2 +- zds/settings/abstract_base/requirements.py | 5 ----- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/requirements.txt b/requirements.txt index a1ee31d0f4..594c8b6f3a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ beautifulsoup4==4.12.2 django-crispy-forms==1.14.0 django-model-utils==4.3.1 django-munin==0.2.1 -django-recaptcha==3.0.0 +django-recaptcha==4.0.0 Django==3.2.23 easy-thumbnails[svg]==2.8.5 factory-boy==3.3.0 diff --git a/zds/member/forms.py b/zds/member/forms.py index 5120802ab6..1f1dbccd69 100644 --- a/zds/member/forms.py +++ b/zds/member/forms.py @@ -8,7 +8,7 @@ from django.utils.safestring import mark_safe from django.utils.translation import gettext_lazy as _ -from captcha.fields import ReCaptchaField +from django_recaptcha.fields import ReCaptchaField from crispy_forms.bootstrap import StrictButton from crispy_forms.helper import FormHelper from crispy_forms.layout import HTML, Layout, Submit, Field, ButtonHolder, Hidden, Div diff --git a/zds/settings/abstract_base/django.py b/zds/settings/abstract_base/django.py index 58b81c5ef3..9aad646410 100644 --- a/zds/settings/abstract_base/django.py +++ b/zds/settings/abstract_base/django.py @@ -163,7 +163,7 @@ "dry_rest_permissions", "corsheaders", "oauth2_provider", - "captcha", + "django_recaptcha", # Apps DB tables are created in THIS order by default # --> Order is CRITICAL to properly handle foreign keys "zds.utils", diff --git a/zds/settings/abstract_base/requirements.py b/zds/settings/abstract_base/requirements.py index d6191176d3..75a3981238 100644 --- a/zds/settings/abstract_base/requirements.py +++ b/zds/settings/abstract_base/requirements.py @@ -51,11 +51,6 @@ recaptcha_config = config.get("recaptcha", {}) USE_CAPTCHA = recaptcha_config.get("use_captcha", False) -# Seems to be used by `django-recaptcha` (what a poorly-namespaced -# setting!). -# Set to `True` to use the “No Captcha” engine instead of the old API. -NOCAPTCHA = True -RECAPTCHA_USE_SSL = True RECAPTCHA_PUBLIC_KEY = recaptcha_config.get("public_key", "dummy") RECAPTCHA_PRIVATE_KEY = recaptcha_config.get("private_key", "dummy")