Ticket #7364: admin_login_cache-8161.diff
File admin_login_cache-8161.diff, 1.4 KB (added by , 16 years ago) |
---|
-
django/contrib/admin/views/decorators.py
12 12 from django.contrib.auth import authenticate, login 13 13 from django.shortcuts import render_to_response 14 14 from django.utils.translation import ugettext_lazy, ugettext as _ 15 from django.views.decorators.cache import never_cache 15 16 16 17 ERROR_MESSAGE = ugettext_lazy("Please enter a correct username and password. Note that both fields are case-sensitive.") 17 18 LOGIN_FORM_KEY = 'this_is_the_login_form' 18 19 20 @never_cache 19 21 def _display_login_form(request, error_message=''): 20 22 request.session.set_test_cookie() 21 23 if request.POST and 'post_data' in request.POST: -
django/contrib/auth/views.py
12 12 from django.utils.translation import ugettext as _ 13 13 from django.contrib.auth.models import User 14 14 import re 15 from django.views.decorators.cache import never_cache 15 16 17 @never_cache 16 18 def login(request, template_name='registration/login.html', redirect_field_name=REDIRECT_FIELD_NAME): 17 19 "Displays the login form and handles the login action." 18 20 redirect_to = request.REQUEST.get(redirect_field_name, '')