diff options
author | Wookey <wookey@wookware.org> | 2013-07-02 21:11:07 +0100 |
---|---|---|
committer | Wookey <wookey@wookware.org> | 2013-07-02 21:11:07 +0100 |
commit | c362b1b5294f8da73bf3bc56c9a36b5454406821 (patch) | |
tree | 102ed01e0f8eba0b78e0532ddfb39474f2d01a13 /registration/views.py | |
parent | f90b6dc7ab2cfce4672ead76abcc81ced0b8a4aa (diff) | |
download | troggle-c362b1b5294f8da73bf3bc56c9a36b5454406821.tar.gz troggle-c362b1b5294f8da73bf3bc56c9a36b5454406821.tar.bz2 troggle-c362b1b5294f8da73bf3bc56c9a36b5454406821.zip |
3rd attempt at getting the right syntax for the CSRF protection in
Diffstat (limited to 'registration/views.py')
-rw-r--r-- | registration/views.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/registration/views.py b/registration/views.py index 9603b56..8228fa9 100644 --- a/registration/views.py +++ b/registration/views.py @@ -7,13 +7,11 @@ from django.contrib.auth import authenticate from django.conf import settings from django.core.urlresolvers import reverse +from django.core.context_processors import csrf from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from django.template import RequestContext from django.contrib.auth import login -#Add CSRF protection: -from django.core.context_processors import csrf -from django.shortcuts import render_to_response from registration.forms import RegistrationForm from registration.models import RegistrationProfile @@ -82,9 +80,9 @@ def activate(request, activation_key, for key, value in extra_context.items(): context[key] = callable(value) and value() or value return render_to_response(template_name, - { 'account': account, - 'expiration_days': settings.ACCOUNT_ACTIVATION_DAYS, 'settings':settings}, - context_instance=context, c) + c.update({ 'account': account, + 'expiration_days': settings.ACCOUNT_ACTIVATION_DAYS, 'settings':settings}), + context_instance=context,) def register(request, success_url=None, @@ -168,5 +166,5 @@ def register(request, success_url=None, for key, value in extra_context.items(): context[key] = callable(value) and value() or value return render_to_response(template_name, - { 'form': form,'settings':settings }, - context_instance=context, c) + c.update({ 'form': form,'settings':settings }), + context_instance=context) |