forked from TagesschuleElementa/www.tagesschule-elementa.ch
recaptcha form fix
This commit is contained in:
@@ -8,6 +8,9 @@ from djangocms_picture.cms_plugins import PicturePlugin as _PicturePlugin
|
||||
from djangocms_text_ckeditor.cms_plugins import TextPlugin as _TextPlugin
|
||||
from django.contrib import admin
|
||||
from mailchimp3 import MailChimp
|
||||
from aldryn_forms.cms_plugins import Field
|
||||
from snowpenguin.django.recaptcha2.fields import ReCaptchaField
|
||||
from snowpenguin.django.recaptcha2.widgets import ReCaptchaWidget
|
||||
|
||||
from project.forms import NewsletterSubscriptionForm
|
||||
from project.models import Section, Quote, SliderItem, SectionText, Video, DownloadSection, DownloadSectionFolder, \
|
||||
@@ -206,6 +209,24 @@ class FormPlugin(_FormPlugin):
|
||||
'SubmitButton', 'ReCaptchaFieldPlugin']
|
||||
|
||||
|
||||
@plugin_pool.register_plugin
|
||||
class ReCaptchaFieldPlugin(Field):
|
||||
name = 'ReCaptcha Field'
|
||||
render_template = True
|
||||
allow_children = False
|
||||
form_field = ReCaptchaField
|
||||
form_field_widget = ReCaptchaWidget
|
||||
|
||||
form_field_enabled_options = [
|
||||
'error_messages',
|
||||
]
|
||||
fieldset_general_fields = []
|
||||
fieldset_advanced_fields = []
|
||||
|
||||
def get_form_field_widget_kwargs(self, instance):
|
||||
return {'explicit': True}
|
||||
|
||||
|
||||
class SocialMediaListItemInlineAdmin(admin.TabularInline):
|
||||
model = SocialMediaListItem
|
||||
extra = 0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{% load static i18n cms_tags sekizai_tags fontawesome menu_tags %}<!DOCTYPE html>
|
||||
{% load static i18n cms_tags sekizai_tags fontawesome menu_tags recaptcha2 %}<!DOCTYPE html>
|
||||
<html class="r" lang="{{ LANGUAGE_CODE }}">
|
||||
<head>
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
@@ -10,6 +10,8 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="google" content="notranslate">
|
||||
|
||||
{% recaptcha_explicit_support %}
|
||||
|
||||
<meta name="msvalidate.01" content="7E7A1E68251AEDF0AF320164C774E3E8"/>
|
||||
|
||||
{% block extra_meta %}
|
||||
@@ -233,5 +235,7 @@
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
{% recaptcha_explicit_init LANGUAGE_CODE %}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user