Skip to content

Commit

Permalink
newforms-admin: Fixed #6566 - restored never_cache() decorator to adm…
Browse files Browse the repository at this point in the history
…in views.

git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7737 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
spookylukey committed Jun 24, 2008
1 parent 56584a6 commit 1acafa0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions django/contrib/admin/sites.py
Expand Up @@ -6,6 +6,7 @@
from django.utils.safestring import mark_safe
from django.utils.text import capfirst
from django.utils.translation import ugettext_lazy, ugettext as _
from django.views.decorators.cache import never_cache
import base64
import cPickle as pickle
import datetime
Expand Down Expand Up @@ -152,6 +153,7 @@ def model_page(self, request, app_label, model_name, rest_of_url=None):
except KeyError:
raise http.Http404("This model exists but has not been registered with the admin site.")
return admin_obj(request, rest_of_url)
model_page = never_cache(model_page)

def password_change(self, request):
"""
Expand Down Expand Up @@ -196,6 +198,7 @@ def logout(self, request):
"""
from django.contrib.auth.views import logout
return logout(request)
logout = never_cache(logout)

def login(self, request):
"""
Expand Down Expand Up @@ -255,6 +258,7 @@ def login(self, request):
return http.HttpResponseRedirect(request.path)
else:
return self.display_login_form(request, ERROR_MESSAGE)
login = never_cache(login)

def index(self, request, extra_context=None):
"""
Expand Down Expand Up @@ -308,6 +312,7 @@ def index(self, request, extra_context=None):
return render_to_response(self.index_template or 'admin/index.html', context,
context_instance=template.RequestContext(request)
)
index = never_cache(index)

def display_login_form(self, request, error_message='', extra_context=None):
request.session.set_test_cookie()
Expand Down

0 comments on commit 1acafa0

Please sign in to comment.