Skip to content

Commit

Permalink
Bump django-recaptcha from 3.0.0 to 4.0.0 (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored Feb 12, 2024
1 parent 72bedc3 commit bcc3a9f
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ django-localflavor = "4.0"
django-localflavor-us = "1.1"
django-material = "1.12.0"
django-materialize-css = "0.0.1"
django-recaptcha = "^3.0.0"
django-recaptcha = "^4.0.0"
django-render-block = "0.9.2"
django-storages = "^1.13.2"
djangorestframework = "3.14.0"
Expand Down
4 changes: 2 additions & 2 deletions tests/views/test_card_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion virtual_library_card/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"compressor",
"absoluteuri",
"virtuallibrarycard.apps.VirtuallibrarycardConfig",
"captcha",
"django_recaptcha",
]

# Log level is taken from the env
Expand Down
2 changes: 1 addition & 1 deletion virtual_library_card/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
4 changes: 2 additions & 2 deletions virtuallibrarycard/forms/forms_library_card.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"]
Expand Down

0 comments on commit bcc3a9f

Please sign in to comment.