# HG changeset patch # User dellsystem # Date 1350282241 14400 # Node ID a5547f079190b3c0853ee7170f5b8ab92b1bcbca # Parent aa9a594334c771fb8b53576ff80d8f04c991ed81 Fix bug in registration django-registration's RegistrationForm isn't a ModelForm, it's just a Form, so there's no save method. Have to create the account manually. diff -r aa9a594334c7 -r a5547f079190 views.py --- a/views.py Mon Oct 15 01:51:50 2012 -0400 +++ b/views.py Mon Oct 15 02:24:01 2012 -0400 @@ -1,4 +1,5 @@ from django.contrib.auth import login, authenticate +from django.contrib.auth.models import User from django.contrib.auth.forms import AuthenticationForm from django.shortcuts import render, redirect from django.core.urlresolvers import reverse @@ -45,7 +46,12 @@ form = RegistrationForm(request.POST) if form.is_valid(): - user = form.save() + username = form.cleaned_data['username'] + email = form.cleaned_data['email'] + password = form.cleaned_data['password1'] + + User.objects.create_user(username, email, password) + user = authenticate(username=username, password=password) login(request, user) return redirect(next_url) else: