Fixed #7364 -- Never cache the contrib.auth login view.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8383 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
90c67e0f55
commit
415bf3efb3
|
@ -14,6 +14,7 @@ from django.utils.http import urlquote, base36_to_int
|
||||||
from django.utils.html import escape
|
from django.utils.html import escape
|
||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
|
from django.views.decorators.cache import never_cache
|
||||||
import re
|
import re
|
||||||
|
|
||||||
def login(request, template_name='registration/login.html', redirect_field_name=REDIRECT_FIELD_NAME):
|
def login(request, template_name='registration/login.html', redirect_field_name=REDIRECT_FIELD_NAME):
|
||||||
|
@ -43,6 +44,7 @@ def login(request, template_name='registration/login.html', redirect_field_name=
|
||||||
redirect_field_name: redirect_to,
|
redirect_field_name: redirect_to,
|
||||||
'site_name': current_site.name,
|
'site_name': current_site.name,
|
||||||
}, context_instance=RequestContext(request))
|
}, context_instance=RequestContext(request))
|
||||||
|
login = never_cache(login)
|
||||||
|
|
||||||
def logout(request, next_page=None, template_name='registration/logged_out.html'):
|
def logout(request, next_page=None, template_name='registration/logged_out.html'):
|
||||||
"Logs out the user and displays 'You are logged out' message."
|
"Logs out the user and displays 'You are logged out' message."
|
||||||
|
|
Loading…
Reference in New Issue