diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-08-13 15:44:47 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-08-13 15:44:47 +0200 |
| commit | e21eea5772523d852fbd0113569651e6c157a7ec (patch) | |
| tree | 5bcc5a3481bc927ebce736c1b7f084ff834a5779 /fundraising | |
| parent | 43df311168476b66cdab07cf59aaf2476cff1546 (diff) | |
Reverted "Added `invisible` recapthca to donations form. (#928)"
This reverts commit 43df311168476b66cdab07cf59aaf2476cff1546.
Diffstat (limited to 'fundraising')
| -rw-r--r-- | fundraising/forms.py | 6 | ||||
| -rw-r--r-- | fundraising/templatetags/fundraising_extras.py | 4 | ||||
| -rw-r--r-- | fundraising/urls.py | 1 | ||||
| -rw-r--r-- | fundraising/views.py | 16 |
4 files changed, 2 insertions, 25 deletions
diff --git a/fundraising/forms.py b/fundraising/forms.py index 8a5b93d5..d215a95f 100644 --- a/fundraising/forms.py +++ b/fundraising/forms.py @@ -1,6 +1,4 @@ import stripe -from captcha.fields import ReCaptchaField -from captcha.widgets import ReCaptchaV3 from django import forms from django.conf import settings from django.core.mail import send_mail @@ -277,7 +275,3 @@ class PaymentForm(forms.Form): ) return donation - - -class ReCaptchaForm(forms.Form): - captcha = ReCaptchaField(widget=ReCaptchaV3) diff --git a/fundraising/templatetags/fundraising_extras.py b/fundraising/templatetags/fundraising_extras.py index 4d86573f..150317b7 100644 --- a/fundraising/templatetags/fundraising_extras.py +++ b/fundraising/templatetags/fundraising_extras.py @@ -5,7 +5,7 @@ from django.conf import settings from django.db import models from django.template.defaultfilters import floatformat -from fundraising.forms import DonateForm, ReCaptchaForm +from fundraising.forms import DonateForm from fundraising.models import ( DEFAULT_DONATION_AMOUNT, DISPLAY_DONOR_DAYS, GOAL_AMOUNT, GOAL_START_DATE, LEADERSHIP_LEVEL_AMOUNT, DjangoHero, InKindDonor, Payment, @@ -51,7 +51,6 @@ def donation_form_with_heart(context): form = DonateForm(initial={ 'amount': DEFAULT_DONATION_AMOUNT, }) - form_captcha = ReCaptchaForm() return { 'goal_amount': GOAL_AMOUNT, @@ -59,7 +58,6 @@ def donation_form_with_heart(context): 'donated_amount': donated_amount, 'total_donors': total_donors, 'form': form, - 'form_captcha': form_captcha, 'display_logo_amount': LEADERSHIP_LEVEL_AMOUNT, 'stripe_publishable_key': settings.STRIPE_PUBLISHABLE_KEY, 'user': user, diff --git a/fundraising/urls.py b/fundraising/urls.py index 16f5fd9b..4a3562ee 100644 --- a/fundraising/urls.py +++ b/fundraising/urls.py @@ -6,7 +6,6 @@ app_name = 'fundraising' urlpatterns = [ path('', views.index, name='index'), path('donate/', views.donate, name='donate'), - path('verify/', views.verify_captcha, name='verify-captcha'), path('thank-you/<donation>/', views.thank_you, name='thank-you'), path('manage-donations/<hero>/', views.manage_donations, name='manage-donations'), path('manage-donations/<hero>/cancel/', views.cancel_donation, name='cancel-donation'), diff --git a/fundraising/views.py b/fundraising/views.py index 47b2cc6e..33124bc6 100644 --- a/fundraising/views.py +++ b/fundraising/views.py @@ -14,7 +14,7 @@ from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_POST from .exceptions import DonationError -from .forms import DjangoHeroForm, DonationForm, PaymentForm, ReCaptchaForm +from .forms import DjangoHeroForm, DonationForm, PaymentForm from .models import ( LEADERSHIP_LEVEL_AMOUNT, DjangoHero, Donation, Payment, Testimonial, ) @@ -28,20 +28,6 @@ def index(request): @require_POST -def verify_captcha(request): - form = ReCaptchaForm(request.POST) - - if form.is_valid(): - data = {'success': True} - else: - data = { - 'success': False, - 'error': form.errors - } - return JsonResponse(data) - - -@require_POST def donate(request): form = PaymentForm(request.POST) |
