diff --git a/apps/nominations/forms.py b/apps/nominations/forms.py index a86aab2..0deea0d 100644 --- a/apps/nominations/forms.py +++ b/apps/nominations/forms.py @@ -1,9 +1,11 @@ from django import forms from django.forms import ModelForm +from captcha.fields import CaptchaField from django.utils.translation import gettext_lazy as _ from .models import Nomination class NominationForm(ModelForm): + captcha = CaptchaField() class Meta: model = Nomination fields = ['nominated', 'reasons_nomination', 'name', 'email', 'sk', 'dg', 'pep', 'ccc'] diff --git a/apps/nominations/templates/pages/nominierungen.html b/apps/nominations/templates/pages/nominierungen.html index 9b38b1a..1921f0c 100644 --- a/apps/nominations/templates/pages/nominierungen.html +++ b/apps/nominations/templates/pages/nominierungen.html @@ -48,7 +48,7 @@ {% endif %} {% nevercache %} {% if field.errors %} -

{{field.errors}}

+
{{field.errors}}
{% endif %} {% endnevercache %} diff --git a/bigbrother/settings.py b/bigbrother/settings.py index 8fafa32..8313557 100644 --- a/bigbrother/settings.py +++ b/bigbrother/settings.py @@ -263,6 +263,7 @@ INSTALLED_APPS = ( "mezzanine.twitter", # "mezzanine.accounts", + "captcha", "apps.blocks", "apps.components.button", "apps.components.icon", diff --git a/bigbrother/urls.py b/bigbrother/urls.py index 6a229b1..3d12b06 100644 --- a/bigbrother/urls.py +++ b/bigbrother/urls.py @@ -16,7 +16,9 @@ import os admin.autodiscover() -urlpatterns = [] +urlpatterns = [ + url(r'^captcha/', include('captcha.urls')), +] # Add the urlpatterns for any custom Django applications here. # You can also change the ``home`` view to add your own functionality