From e87da65ea503d05a09fdb003c28621a11bf73942 Mon Sep 17 00:00:00 2001 From: Elma Nevala Date: Sun, 29 Jan 2023 19:51:27 +0200 Subject: [PATCH] =?UTF-8?q?captcha=20h=C3=A4irint=C3=A4lomakkeeseen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- palautteet/hairinta/forms.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/palautteet/hairinta/forms.py b/palautteet/hairinta/forms.py index 726df21c..9467da3c 100644 --- a/palautteet/hairinta/forms.py +++ b/palautteet/hairinta/forms.py @@ -1,6 +1,8 @@ from django.forms.fields import CharField, BooleanField from django.forms.widgets import Textarea, CheckboxInput, TextInput +from captcha.fields import ReCaptchaField + from ..forms import ContactsForm @@ -25,7 +27,11 @@ class Media: required=False ) + captcha = ReCaptchaField() + def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.fields.get('email').widget = TextInput(attrs=dict(style='display: none')) self.fields.get('name').widget = TextInput(attrs=dict(style='display: none')) + +