From b06d1ba3c2e51f17f95c0cedf5b23469233f2f33 Mon Sep 17 00:00:00 2001 From: Anders Bruun Severinsen <202204885@post.au.dk> Date: Fri, 18 Oct 2024 02:44:35 +0200 Subject: [PATCH] Went back to ReCaptchaV2Checkbox --- bartenders/forms.py | 5 +++-- udlejning/forms.py | 4 ++-- web/templates/plain_base.html | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bartenders/forms.py b/bartenders/forms.py index 09d3808..b0101c8 100644 --- a/bartenders/forms.py +++ b/bartenders/forms.py @@ -6,7 +6,7 @@ from django.urls import reverse from django.utils.safestring import mark_safe from django_recaptcha.fields import ReCaptchaField -from django_recaptcha.widgets import ReCaptchaV2Invisible +from django_recaptcha.widgets import ReCaptchaV2Checkbox from bartab.models import BarTabUser from fredagscafeen.email import send_template_email @@ -15,7 +15,7 @@ class BartenderApplicationForm(forms.ModelForm): - captcha = ReCaptchaField(widget=ReCaptchaV2Invisible) + captcha = ReCaptchaField(widget=ReCaptchaV2Checkbox) class Meta: model = BartenderApplication @@ -27,6 +27,7 @@ def __init__(self, *args, **kwargs): self.fields["tshirt_size"].widget.attrs.update({"class": "form-control"}) for name in self.fields: self.fields[name].required = name != "info" + self.fields["captcha"].widget.attrs.update({"class": "g-recaptcha"}) def send_email(self, pk): d = self.cleaned_data diff --git a/udlejning/forms.py b/udlejning/forms.py index 355bbcb..9dd5106 100644 --- a/udlejning/forms.py +++ b/udlejning/forms.py @@ -6,7 +6,7 @@ from django.urls import reverse from django.utils.safestring import mark_safe from django_recaptcha.fields import ReCaptchaField -from django_recaptcha.widgets import ReCaptchaV2Invisible +from django_recaptcha.widgets import ReCaptchaV2Checkbox from fredagscafeen.email import send_template_email @@ -14,7 +14,7 @@ class UdlejningApplicationForm(forms.ModelForm): - captcha = ReCaptchaField(widget=ReCaptchaV2Invisible) + captcha = ReCaptchaField(widget=ReCaptchaV2Checkbox) class Meta: model = UdlejningApplication diff --git a/web/templates/plain_base.html b/web/templates/plain_base.html index ab9a3e0..26f8451 100644 --- a/web/templates/plain_base.html +++ b/web/templates/plain_base.html @@ -27,7 +27,7 @@