+class WLRegisterView(FormView):
+ form_class = RegistrationForm
+ template_name = 'registration/register.html'
+
+ def form_valid(self, form):
+ form.save()
+ user = auth.authenticate(
+ username=form.cleaned_data['username'],
+ password=form.cleaned_data['password1']
+ )
+ auth.login(self.request, user)
+ return HttpResponseRedirect(quote_plus(self.request.GET.get('next', '/'), safe='/?='))
+
+wl_register_view = WLRegisterView.as_view()
+
+