diff --git a/README.md b/README.md index b2f5798..eba530a 100644 --- a/README.md +++ b/README.md @@ -161,9 +161,9 @@ The site should be available in your browser for testing at `https://localhost:8 ## Other settings -The `RECAPTCHA_PUBLIC_KEY` and `RECAPTCHA_PRIVATE_KEY` must be set if the `captcha` django plugin +The `RECAPTCHA_PUBLIC_KEY` and `RECAPTCHA_PRIVATE_KEY` must be set if the `django_recaptcha` django plugin is installed via the `INSTALLED_APPS` setting. -If the `captcha` App is not in the `INSTALLED_APPS` setting, the signup flow will silently remove the need for +If the `django_recaptcha` App is not in the `INSTALLED_APPS` setting, the signup flow will silently remove the need for captcha to be present on that page. ### Environment Variables diff --git a/tests/views/test_card_views.py b/tests/views/test_card_views.py index 45ae0ee..80439fc 100644 --- a/tests/views/test_card_views.py +++ b/tests/views/test_card_views.py @@ -387,11 +387,11 @@ def test_card_request_email_no_duplicates(self): def test_card_request_no_captcha_installed(self): # Remove captcha from the installed apps installed_apps = [ac.name for ac in apps.get_app_configs()] - installed_apps.remove("captcha") + installed_apps.remove("django_recaptcha") apps.set_installed_apps(installed_apps) new_apps = [ac.name for ac in apps.get_app_configs()] - assert "captcha" not in new_apps + assert "django_recaptcha" not in new_apps self.test_card_request(with_captcha=False) apps.unset_installed_apps() diff --git a/virtual_library_card/settings/base.py b/virtual_library_card/settings/base.py index d1354eb..cc191ae 100644 --- a/virtual_library_card/settings/base.py +++ b/virtual_library_card/settings/base.py @@ -38,7 +38,7 @@ "compressor", "absoluteuri", "virtuallibrarycard.apps.VirtuallibrarycardConfig", - "captcha", + "django_recaptcha", ] # Log level is taken from the env diff --git a/virtual_library_card/settings/dev.py b/virtual_library_card/settings/dev.py index ba60f27..e437d1b 100644 --- a/virtual_library_card/settings/dev.py +++ b/virtual_library_card/settings/dev.py @@ -26,7 +26,7 @@ } # Testing ONLY -SILENCED_SYSTEM_CHECKS = ["captcha.recaptcha_test_key_error"] +SILENCED_SYSTEM_CHECKS = ["django_recaptcha.recaptcha_test_key_error"] ABSOLUTEURI_PROTOCOL = "http" DATE_INPUT_FORMATS = ["%m-%d-%Y"] diff --git a/virtuallibrarycard/forms/forms_library_card.py b/virtuallibrarycard/forms/forms_library_card.py index 1691a3a..b505d62 100644 --- a/virtuallibrarycard/forms/forms_library_card.py +++ b/virtuallibrarycard/forms/forms_library_card.py @@ -1,12 +1,12 @@ from datetime import datetime -from captcha.fields import ReCaptchaField from django import forms from django.apps import apps from django.contrib.auth.forms import UserCreationForm from django.core.exceptions import ValidationError from django.forms import ModelForm from django.utils.translation import gettext as _ +from django_recaptcha.fields import ReCaptchaField from virtual_library_card.logging import LoggingMixin from virtual_library_card.sender import Sender @@ -54,7 +54,7 @@ def __init__(self, *args, **kwargs): self.fields["first_name"].required = True # keep the captcha part dynamic, in case captcha is not supported - if apps.is_installed("captcha"): + if apps.is_installed("django_recaptcha"): self.fields["captcha"] = ReCaptchaField() user = kwargs["instance"]