Code

Ticket #7629: login_cache.diff

File login_cache.diff, 810 bytes (added by permon, 6 years ago)
Line 
1Index: django/contrib/admin/views/decorators.py
2===================================================================
3--- django/contrib/admin/views/decorators.py    (revision 7834)
4+++ django/contrib/admin/views/decorators.py    (working copy)
5@@ -12,10 +12,12 @@
6 from django.contrib.auth import authenticate, login
7 from django.shortcuts import render_to_response
8 from django.utils.translation import ugettext_lazy, ugettext as _
9+from django.views.decorators.cache import never_cache
10 
11 ERROR_MESSAGE = ugettext_lazy("Please enter a correct username and password. Note that both fields are case-sensitive.")
12 LOGIN_FORM_KEY = 'this_is_the_login_form'
13 
14+@never_cache
15 def _display_login_form(request, error_message=''):
16     request.session.set_test_cookie()
17     if request.POST and 'post_data' in request.POST: