Thursday, July 22, 2010

NotImplementedException when trying to log user in after registration

Hi,

I get a NotImplementedException when I try to log a user in right
after they register.

Here is the source code:

def create_account(request):
if request.method == 'POST':
form = UserCreationForm(request.POST)
if form.is_valid():
user = form.save()
authenticated_user = authenticate(username=user.username,
password=user.password)
login(request, authenticated_user)
return redirect(profile)
else:
form = UserCreationForm()
return render_to_response('registration/create_account.html', {
'form': form,
}, context_instance=RequestContext(request))

And here is the stack trace:

File "/home/jeff/.virtualenvs/osl_main-website/lib/python2.6/site-
packages/django/core/handlers/base.py" in get_response
100. response = callback(request,
*callback_args, **callback_kwargs)
File "/home/jeff/projects/osl-main-website/wluopensource/accounts/
views.py" in create_account
17. login(request, authenticated_user)
File "/home/jeff/.virtualenvs/osl_main-website/lib/python2.6/site-
packages/django/contrib/auth/__init__.py" in login
69. user.save()
File "/home/jeff/.virtualenvs/osl_main-website/lib/python2.6/site-
packages/django/contrib/auth/models.py" in save
427. raise NotImplementedError

Exception Type: NotImplementedError at /accounts/create_account/
Exception Value:

Thanks in advance for any help you can provide!

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment