From 808acfe13aa299cc0d800c9e9c2e8dec764b8be3 Mon Sep 17 00:00:00 2001 From: Corentin Chary Date: Mon, 29 Oct 2012 12:46:37 +0100 Subject: [PATCH] django-recaptcha 0.0.5 compat Signed-off-by: Corentin Chary --- euscanwww/djeuscan/processing/scan/scan_upstream.py | 2 +- euscanwww/euscanwww/captcha/__init__.py | 6 ++++++ euscanwww/euscanwww/captcha/forms.py | 5 +++++ euscanwww/euscanwww/captcha/urls.py | 12 ++++++++++++ euscanwww/euscanwww/settings.py | 1 + euscanwww/euscanwww/urls.py | 2 +- 6 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 euscanwww/euscanwww/captcha/__init__.py create mode 100644 euscanwww/euscanwww/captcha/forms.py create mode 100644 euscanwww/euscanwww/captcha/urls.py diff --git a/euscanwww/djeuscan/processing/scan/scan_upstream.py b/euscanwww/djeuscan/processing/scan/scan_upstream.py index bc9159b..6ec2b76 100644 --- a/euscanwww/djeuscan/processing/scan/scan_upstream.py +++ b/euscanwww/djeuscan/processing/scan/scan_upstream.py @@ -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 ) diff --git a/euscanwww/euscanwww/captcha/__init__.py b/euscanwww/euscanwww/captcha/__init__.py new file mode 100644 index 0000000..a6b282a --- /dev/null +++ b/euscanwww/euscanwww/captcha/__init__.py @@ -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 diff --git a/euscanwww/euscanwww/captcha/forms.py b/euscanwww/euscanwww/captcha/forms.py new file mode 100644 index 0000000..ca4a876 --- /dev/null +++ b/euscanwww/euscanwww/captcha/forms.py @@ -0,0 +1,5 @@ +from captcha.fields import ReCaptchaField +from registration.forms import RegistrationForm + +class RegistrationFormCaptcha(RegistrationForm): + captcha = ReCaptchaField(attrs={'theme': 'white'}) diff --git a/euscanwww/euscanwww/captcha/urls.py b/euscanwww/euscanwww/captcha/urls.py new file mode 100644 index 0000000..76cbd2e --- /dev/null +++ b/euscanwww/euscanwww/captcha/urls.py @@ -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' + ), +) diff --git a/euscanwww/euscanwww/settings.py b/euscanwww/euscanwww/settings.py index d6b8616..5705c3b 100644 --- a/euscanwww/euscanwww/settings.py +++ b/euscanwww/euscanwww/settings.py @@ -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' diff --git a/euscanwww/euscanwww/urls.py b/euscanwww/euscanwww/urls.py index d6090b5..b104339 100644 --- a/euscanwww/euscanwww/urls.py +++ b/euscanwww/euscanwww/urls.py @@ -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')), )