From 0dfeb359acd7844d1642d958ac3a49564f66c2a5 Mon Sep 17 00:00:00 2001 From: Simon Caminada Date: Sun, 3 May 2020 13:18:45 +0200 Subject: [PATCH 1/3] fix --- settings.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/settings.py b/settings.py index 1aef92a..a186df3 100644 --- a/settings.py +++ b/settings.py @@ -4,15 +4,6 @@ import os import sentry_sdk from sentry_sdk.integrations.django import DjangoIntegration -sentry_sdk.init( - dsn="https://460e310d034c49a794941e087c4fcc6e@o74423.ingest.sentry.io/1196285", - integrations=[DjangoIntegration()], - - # If you wish to associate users to errors (assuming you are using - # django.contrib.auth) you may enable sending PII data. - send_default_pii=True -) - INSTALLED_ADDONS = [ # # Warning: text inside the INSTALLED_ADDONS tags is auto-generated. Manual changes will be overwritten. 'aldryn-addons', @@ -256,3 +247,12 @@ if not DEBUG: ] DATA_UPLOAD_MAX_MEMORY_SIZE = 1024 * 1024 * 1024 + +sentry_sdk.init( + dsn="https://460e310d034c49a794941e087c4fcc6e@o74423.ingest.sentry.io/1196285", + integrations=[DjangoIntegration()], + + # If you wish to associate users to errors (assuming you are using + # django.contrib.auth) you may enable sending PII data. + send_default_pii=True +) From 8eeb5f5947a63283a0a98e085718fe70885fad23 Mon Sep 17 00:00:00 2001 From: Simon Caminada Date: Sun, 3 May 2020 13:31:32 +0200 Subject: [PATCH 2/3] fix --- settings.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/settings.py b/settings.py index a186df3..1aef92a 100644 --- a/settings.py +++ b/settings.py @@ -4,6 +4,15 @@ import os import sentry_sdk from sentry_sdk.integrations.django import DjangoIntegration +sentry_sdk.init( + dsn="https://460e310d034c49a794941e087c4fcc6e@o74423.ingest.sentry.io/1196285", + integrations=[DjangoIntegration()], + + # If you wish to associate users to errors (assuming you are using + # django.contrib.auth) you may enable sending PII data. + send_default_pii=True +) + INSTALLED_ADDONS = [ # # Warning: text inside the INSTALLED_ADDONS tags is auto-generated. Manual changes will be overwritten. 'aldryn-addons', @@ -247,12 +256,3 @@ if not DEBUG: ] DATA_UPLOAD_MAX_MEMORY_SIZE = 1024 * 1024 * 1024 - -sentry_sdk.init( - dsn="https://460e310d034c49a794941e087c4fcc6e@o74423.ingest.sentry.io/1196285", - integrations=[DjangoIntegration()], - - # If you wish to associate users to errors (assuming you are using - # django.contrib.auth) you may enable sending PII data. - send_default_pii=True -) From 2dd84d27f0ce0f895f6f3fc7dbf1774bebf6ecd6 Mon Sep 17 00:00:00 2001 From: Simon Caminada Date: Mon, 7 Sep 2020 15:53:28 +0200 Subject: [PATCH 3/3] add recaptcha plugin --- requirements.in | 12 +++++++++++- settings.py | 7 +++++++ src/project/cms_plugins.py | 7 +------ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/requirements.in b/requirements.in index 0578785..263c27c 100644 --- a/requirements.in +++ b/requirements.in @@ -21,4 +21,14 @@ django-image-cropping==1.2.0 django-anymail[mailgun]==1.4 django-admin-view-permission==1.9 gunicorn==19.9.0 -sentry-sdk==0.14.3 \ No newline at end of file +sentry-sdk==0.14.3 +aldryn-forms-recaptcha-plugin==1.0.0.2 +django-recaptcha2==1.4.1 +# compat versions +django-storages<1.9 +psycopg2<2.8 +django-parler<=2.1 +django-select2<=6.3.1 +django-sekizai<=1.1.0 +django-classy-tags<=1.0.0 +djangocms-attributes-field<=1.2.0 \ No newline at end of file diff --git a/settings.py b/settings.py index 1aef92a..119079a 100644 --- a/settings.py +++ b/settings.py @@ -38,6 +38,8 @@ aldryn_addons.settings.load(locals()) INSTALLED_APPS.insert(0, 'admin_view_permission') INSTALLED_APPS.extend([ + 'aldryn_forms_recaptcha_plugin', + 'snowpenguin.django.recaptcha3', 'portal', 'project', 'fontawesome', @@ -256,3 +258,8 @@ if not DEBUG: ] DATA_UPLOAD_MAX_MEMORY_SIZE = 1024 * 1024 * 1024 + +RECAPTCHA_PUBLIC_KEY = '6Lec78gZAAAAANc-oxXJPMi7BXmINlP-QkcS937g' +RECAPTCHA_PRIVATE_KEY = '6Lec78gZAAAAADuIppqW7cSh6iPw3TZQ9r-ogHtz' + +RECAPTCHA_SCORE_THRESHOLD = 0.5 diff --git a/src/project/cms_plugins.py b/src/project/cms_plugins.py index 1d145b9..5972fd7 100644 --- a/src/project/cms_plugins.py +++ b/src/project/cms_plugins.py @@ -203,12 +203,7 @@ class FormPlugin(_FormPlugin): module = 'Content' name = 'Form' child_classes = ['TextField', 'TextAreaField', 'EmailField', 'RadioSelectField', 'MultipleSelectField', - 'SubmitButton'] - - def send_notifications(self, instance, form): - if dict(form.get_serialized_field_choices()).get('honeypot', ''): - return [] - return super(FormPlugin, self).send_notifications(instance, form) + 'SubmitButton', 'ReCaptchaFieldPlugin'] class SocialMediaListItemInlineAdmin(admin.TabularInline):