fixes
This commit is contained in:
parent
4fef44668c
commit
8c6bdebcab
@ -1,4 +1,4 @@
|
|||||||
from django.conf.urls.defaults import url, patterns, include
|
from django.conf.urls import url, patterns, include
|
||||||
from django.contrib.auth.decorators import user_passes_test
|
from django.contrib.auth.decorators import user_passes_test
|
||||||
|
|
||||||
from djcelery.views import apply as apply_task
|
from djcelery.views import apply as apply_task
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
from registration.backends.default import DefaultBackend
|
#from registration.backends.default import DefaultBackend
|
||||||
from forms import RegistrationFormCaptcha
|
#from forms import RegistrationFormCaptcha
|
||||||
|
#
|
||||||
class CaptchaDefaultBackend(DefaultBackend):
|
#class CaptchaDefaultBackend(DefaultBackend):
|
||||||
def get_form_class(self, request):
|
# def get_form_class(self, request):
|
||||||
return RegistrationFormCaptcha
|
# return RegistrationFormCaptcha
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
from captcha.fields import ReCaptchaField
|
|
||||||
from registration.forms import RegistrationForm
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
class RegistrationFormCaptcha(RegistrationForm):
|
from captcha.fields import ReCaptchaField
|
||||||
|
from registration.forms import RegistrationForm
|
||||||
|
|
||||||
|
class RecaptchaRegistrationForm(RegistrationForm):
|
||||||
captcha = ReCaptchaField(
|
captcha = ReCaptchaField(
|
||||||
public_key=settings.RECAPTCHA_PUBLIC_KEY,
|
public_key=settings.RECAPTCHA_PUBLIC_KEY,
|
||||||
private_key=settings.RECAPTCHA_PRIVATE_KEY,
|
private_key=settings.RECAPTCHA_PRIVATE_KEY,
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
from django.conf.urls.defaults import patterns, url
|
from django.conf.urls import patterns, url
|
||||||
|
|
||||||
from registration.views import register
|
from views import RecaptchaRegistrationView
|
||||||
|
|
||||||
urlpatterns = patterns('',
|
urlpatterns = patterns(
|
||||||
url(
|
'', url(
|
||||||
r'^register/$',
|
r'^register/$',
|
||||||
register,
|
RecaptchaRegistrationView.as_view(),
|
||||||
{'backend': 'euscanwww.captcha.CaptchaDefaultBackend'},
|
name='registration_register'),
|
||||||
name='registration_register'
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user