django-recaptcha 0.0.5 compat

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
This commit is contained in:
Corentin Chary 2012-10-29 12:46:37 +01:00
parent 975f7b1dbf
commit 808acfe13a
6 changed files with 26 additions and 2 deletions

View File

@ -34,7 +34,7 @@ class ScanUpstream(object):
"Error while scanning upstream for package %s!",
package
)
self.logger.debug(
self.logger.info(
"Error %s",
out_json
)

View File

@ -0,0 +1,6 @@
from registration.backends.default import DefaultBackend
from forms import RegistrationFormCaptcha
class CaptchaDefaultBackend(DefaultBackend):
def get_form_class(self, request):
return RegistrationFormCaptcha

View File

@ -0,0 +1,5 @@
from captcha.fields import ReCaptchaField
from registration.forms import RegistrationForm
class RegistrationFormCaptcha(RegistrationForm):
captcha = ReCaptchaField(attrs={'theme': 'white'})

View File

@ -0,0 +1,12 @@
from django.conf.urls.defaults import patterns, url
from registration.views import register
urlpatterns = patterns('',
url(
r'^register/$',
register,
{'backend': 'euscanwww.captcha.CaptchaDefaultBackend'},
name='registration_register'
),
)

View File

@ -267,3 +267,4 @@ except ImportError, ex:
os.environ['ROOT'] = PORTAGE_ROOT
os.environ['PORTAGE_CONFIGROOT'] = PORTAGE_CONFIGROOT
os.environ['EIX_CACHEFILE'] = EIX_CACHEFILE
os.environ['http_proxy'] = '127.0.0.1:8123'

View File

@ -8,7 +8,7 @@ urlpatterns = patterns('',
url(r'^', include('djeuscan.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^accounts/', include('captcha.backends.default.urls')),
url(r'^accounts/', include('euscanwww.captcha.urls')),
url(r'^accounts/', include('registration.backends.default.urls')),
)