From a3c7c5bb5ec3e0645a78d798aee907c6fe605f5d Mon Sep 17 00:00:00 2001 From: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> Date: Wed, 29 Nov 2023 20:41:25 +0100 Subject: [PATCH] Added action to ReCaptchaV3 as recommended. --- contact/forms.py | 2 +- fundraising/forms.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contact/forms.py b/contact/forms.py index ccdd056c2..2748b9827 100644 --- a/contact/forms.py +++ b/contact/forms.py @@ -32,7 +32,7 @@ class BaseContactForm(ContactForm): attrs={"class": "required", "placeholder": "Your message"} ) ) - captcha = ReCaptchaField(widget=ReCaptchaV3) + captcha = ReCaptchaField(widget=ReCaptchaV3(action="contact_form")) def subject(self): # Strip all linebreaks from the subject string. diff --git a/fundraising/forms.py b/fundraising/forms.py index e757d4322..7235ae0dc 100644 --- a/fundraising/forms.py +++ b/fundraising/forms.py @@ -134,7 +134,7 @@ class DonateForm(forms.Form): amount = forms.ChoiceField(choices=AMOUNT_CHOICES) interval = forms.ChoiceField(choices=INTERVAL_CHOICES) - captcha = ReCaptchaField(widget=ReCaptchaV3) + captcha = ReCaptchaField(widget=ReCaptchaV3(action="donate_form")) class DonationForm(forms.ModelForm): @@ -176,7 +176,7 @@ class PaymentForm(forms.Form): `amount` can be any integer, so a ChoiceField is not appropriate. """ - captcha = ReCaptchaField(widget=ReCaptchaV3) + captcha = ReCaptchaField(widget=ReCaptchaV3(action="payment_form")) amount = forms.IntegerField( required=True, min_value=1, # Minimum payment from Stripe API