aboutsummaryrefslogtreecommitdiffstats
path: root/account
diff options
context:
space:
mode:
authorWeitian LI <liweitianux@gmail.com>2014-04-25 21:56:48 +0800
committerWeitian LI <liweitianux@gmail.com>2014-04-25 21:56:48 +0800
commitc0a125cf62c09336cbb73ab7385bd9dd93ba4cd4 (patch)
tree0e660737992968ba4950414ebf541f020de9e0e0 /account
parentfdca25093fc6ae361ffd903e5cc8a11d5cd724d0 (diff)
downloaddjango-skaschool-c0a125cf62c09336cbb73ab7385bd9dd93ba4cd4.tar.bz2
* installed 'django-recaptcha'
* added 'captcha' field to UserRegForm
Diffstat (limited to 'account')
-rw-r--r--account/forms.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/account/forms.py b/account/forms.py
index f5f515f..c7e15d3 100644
--- a/account/forms.py
+++ b/account/forms.py
@@ -7,9 +7,11 @@ account/forms.py for skaschool
from django import forms
from django.contrib.auth.models import User
from django.contrib.sites.models import Site, RequestSite
-from registration.forms import RegistrationFormUniqueEmail
from django.utils.translation import ugettext_lazy as _
+from registration.forms import RegistrationFormUniqueEmail
+from captcha.fields import ReCaptchaField
+
from account.models import UserProfile
@@ -25,6 +27,8 @@ class UserRegForm(RegistrationFormUniqueEmail):
gender = forms.ChoiceField(choices=GENDERS, label=_("Gender"))
institute = forms.CharField(max_length=100, label=_("Institute"))
identify = forms.ChoiceField(choices=IDENTIFIES, label=_("Identify"))
+ captcha = ReCaptchaField(label=_("Captcha"),
+ attrs={'theme': 'clean'})
#def __init__(self, *args, **kw):
# super(UserRegForm, self).__init__(*args, **kw)