Add toolparamdescription to contact fields, move reCAPTCHA outside the annotated form, and always render declarative WebMCP form attributes.
16 lines
484 B
Python
16 lines
484 B
Python
from django import forms
|
|
from django_recaptcha.fields import ReCaptchaField
|
|
from django_recaptcha.widgets import ReCaptchaV3
|
|
from django.conf import settings
|
|
|
|
class FormWithCaptcha(forms.Form):
|
|
captcha = ReCaptchaField(
|
|
widget=ReCaptchaV3(
|
|
attrs={
|
|
'required_score': 0.85,
|
|
'form': 'contact-form',
|
|
}
|
|
),
|
|
public_key=settings.RECAPTCHA_PUBLIC_KEY,
|
|
private_key=settings.RECAPTCHA_PRIVATE_KEY,
|
|
) |