update registration

pull/1/head
eric 2016-07-22 18:42:19 -04:00
parent 9da195dcc8
commit 5b4badb7e6
3 changed files with 6 additions and 7 deletions

View File

@ -58,6 +58,6 @@ urlpatterns = patterns(
) ),
url(r'^socialauth/', include('social.apps.django_app.urls', namespace='social')),
url('accounts/', include('email_change.urls')),
url(r'^accounts/', include('registration.backends.default.urls')),
url(r'^accounts/', include('registration.backends.model_activation.urls')),
url(r'^accounts/', include('django.contrib.auth.urls')),
)

View File

@ -8,7 +8,7 @@ from django.contrib.auth import load_backend
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect
from django.views.generic.edit import FormView, CreateView, UpdateView, SingleObjectMixin
from registration.backends.default.views import RegistrationView
from registration.backends.model_activation.views import RegistrationView
from . import backends
from .models import Library
from .forms import AuthForm, LibraryForm, NewLibraryForm, RegistrationFormNoDisposableEmail
@ -240,11 +240,11 @@ robot_qs = {
class CustomRegistrationView(RegistrationView):
form_class = RegistrationFormNoDisposableEmail
def form_valid(self, request, form):
q = request.session.get('q', False)
def form_valid(self, form):
q = self.request.session.get('q', False)
if q and q in robot_qs:
return self.render_to_response({'form':form})
return super(CustomRegistrationView,self).form_valid(request, form)
return super(CustomRegistrationView,self).form_valid(form)

View File

@ -36,8 +36,7 @@ django-mptt==0.7.4
django-nose-selenium==0.7.3
#django-notification==0.2
git+git://github.com/eshellman/django-notification.git@8bb7afbbb07e8cad74bc1cf17e0ac6fc117c0497
#django-registration==1.0
git+git://github.com/eshellman/django-registration.git@42969216d38a83424f16f46dd49ea6b38062862c
django-registration==2.1.1
django-selectable==0.9.0
django-smtp-ssl==1.0
django-storages==1.1.6