Compare commits

...

2 commits

8 changed files with 18 additions and 2 deletions

View file

@ -1,5 +1,6 @@
# To-do # To-do
* rate limiting to prevent abuse - especially on POST requests
* consider removing `events` and `worldmap` modules * consider removing `events` and `worldmap` modules
* ask Denver about why so many license files * ask Denver about why so many license files

View file

@ -1,9 +1,12 @@
from captcha.fields import CaptchaField
from django import forms from django import forms
from .models import CommunityTrackProposal from .models import CommunityTrackProposal
class CommunityTrackProposalForm(forms.ModelForm): class CommunityTrackProposalForm(forms.ModelForm):
captcha = CaptchaField()
class Meta: class Meta:
model = CommunityTrackProposal model = CommunityTrackProposal
exclude = [] exclude = []

View file

@ -93,6 +93,7 @@ INSTALLED_APPS = [
'conservancy.fossy', 'conservancy.fossy',
'conservancy.podjango', 'conservancy.podjango',
'conservancy.usethesource.apps.UseTheSourceConfig', 'conservancy.usethesource.apps.UseTheSourceConfig',
'captcha',
] ]
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'

View file

@ -40,3 +40,6 @@ SESSION_COOKIE_SECURE = True
STRIPE_API_KEY = get_secret(secrets, 'STRIPE_API_KEY') STRIPE_API_KEY = get_secret(secrets, 'STRIPE_API_KEY')
STRIPE_ENDPOINT_SECRET = get_secret(secrets, 'STRIPE_ENDPOINT_SECRET') STRIPE_ENDPOINT_SECRET = get_secret(secrets, 'STRIPE_ENDPOINT_SECRET')
CAPTCHA_FLITE_PATH = '/usr/bin/flite'
CAPTCHA_SOX_PATH = '/usr/bin/sox'

View file

@ -15,6 +15,7 @@ class SustainerOrderAdmin(admin.ModelAdmin):
'paid_time', 'paid_time',
'payment_method', 'payment_method',
'payment_id', 'payment_id',
'recurring',
'name', 'name',
'email', 'email',
'amount', 'amount',
@ -28,6 +29,6 @@ class SustainerOrderAdmin(admin.ModelAdmin):
'country', 'country',
] ]
readonly_fields = ['created_time', 'paid_time', 'payment_method', 'payment_id'] readonly_fields = ['created_time', 'paid_time', 'payment_method', 'payment_id', 'recurring']
list_display = ['created_time', 'name', 'email', 'amount', 'paid'] list_display = ['created_time', 'name', 'email', 'amount', 'recurring', 'paid_time']
list_filter = ['paid_time'] list_filter = ['paid_time']

View file

@ -61,6 +61,8 @@ urlpatterns = [
re_path(r'^privacy-policy/', views.content), re_path(r'^privacy-policy/', views.content),
re_path(r'^projects/', views.content), re_path(r'^projects/', views.content),
re_path(r'^sustainer/', views.content), re_path(r'^sustainer/', views.content),
path('captcha/', include('captcha.urls')),
] ]
# Serve uploaded media. Works only when DEBUG == True. Using '/media/' # Serve uploaded media. Works only when DEBUG == True. Using '/media/'

View file

@ -130,6 +130,10 @@
apt: apt:
name: build-essential,python3-dev,libffi-dev name: build-essential,python3-dev,libffi-dev
- name: Install flite and sox for CAPTCHA text-to-speech
apt:
name: flite, sox
- name: Security settings - name: Security settings
apt: apt:
name: fail2ban name: fail2ban

View file

@ -6,3 +6,4 @@ stripe
beautifulsoup4==4.11.2 beautifulsoup4==4.11.2
html5lib==1.1 html5lib==1.1
Pillow==9.4.0 Pillow==9.4.0
django-simple-captcha==0.6.0