From 02ab10b420cfceedcda57ecba55185544800d9be Mon Sep 17 00:00:00 2001 From: Matthias Kestenholz Date: Thu, 15 Feb 2024 17:47:05 +0100 Subject: [PATCH] Compatibility with latest django-recaptcha --- CHANGELOG.rst | 2 ++ README.rst | 4 ++-- form_designer/default_field_types.py | 6 +++--- pyproject.toml | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 97cecf8..a2aadef 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,8 @@ Change log Next version ------------ +* Raised the minimum django-recaptcha version to 4.0. + 0.23 ---- diff --git a/README.rst b/README.rst index bb3c1f3..752cecc 100644 --- a/README.rst +++ b/README.rst @@ -128,8 +128,8 @@ ReCaptcha ========= To enable [ReCaptcha](http://www.google.com/recaptcha) install -[django-recaptcha](https://github.com/praekelt/django-recaptcha) and add -`captcha` to your `INSTALLED_APPS`. This will automatically add a ReCaptcha +[django-recaptcha](https://github.com/django-recaptcha/django-recaptcha) and add +`django_recaptcha` to your `INSTALLED_APPS`. This will automatically add a ReCaptcha field to the form designer. For everything else read through the django-recaptcha readme. diff --git a/form_designer/default_field_types.py b/form_designer/default_field_types.py index 23a6503..e3f417b 100644 --- a/form_designer/default_field_types.py +++ b/form_designer/default_field_types.py @@ -81,10 +81,10 @@ def require_choices(field): ] # Add recaptcha field if available -if apps.is_installed("captcha"): # pragma: no cover +if apps.is_installed("django_recaptcha"): # pragma: no cover try: - from captcha.fields import ReCaptchaField - from captcha.widgets import ReCaptchaV2Checkbox, ReCaptchaV3 + from django_recaptcha.fields import ReCaptchaField + from django_recaptcha.widgets import ReCaptchaV2Checkbox, ReCaptchaV3 except ImportError: pass else: diff --git a/pyproject.toml b/pyproject.toml index 06eced5..c8e5880 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ dependencies = [ tests = [ "coverage", "django-mptt", - "django-recaptcha", + "django-recaptcha>=4", "FeinCMS", ] [project.urls]