From 081ed6c8661bbec81cdbb9029e4832b34805f37b Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 22 Jun 2010 12:09:22 -0500 Subject: Add 'never_cache' decorator in a bunch of places Now that we cache everything, we need to ensure anyone doing edits and such gets the live data and not some cached version that was already updated and is now stale. Add the never_cache decorator to any of the CUD screens as well as a few others that might benefit from always being regenerated. Signed-off-by: Dan McGee --- todolists/views.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'todolists') diff --git a/todolists/views.py b/todolists/views.py index 653b511..cdf503a 100644 --- a/todolists/views.py +++ b/todolists/views.py @@ -5,6 +5,7 @@ from django.template import RequestContext from django.core.mail import send_mail from django.shortcuts import get_object_or_404, render_to_response from django.contrib.auth.decorators import login_required, permission_required +from django.views.decorators.cache import never_cache from django.views.decorators.vary import vary_on_headers from django.views.generic.create_update import delete_object from django.template import Context, loader @@ -60,6 +61,7 @@ def list(request): RequestContext(request, {'lists':lists})) @permission_required('main.add_todolist') +@never_cache def add(request): if request.POST: form = TodoListForm(request.POST) @@ -86,6 +88,7 @@ def add(request): RequestContext(request, page_dict)) @permission_required('main.change_todolist') +@never_cache def edit(request, list_id): todo_list = get_object_or_404(Todolist, id=list_id) if request.POST: @@ -124,6 +127,7 @@ def edit(request, list_id): return render_to_response('general_form.html', RequestContext(request, page_dict)) @permission_required('main.delete_todolist') +@never_cache def delete_todolist(request, object_id): return delete_object(request, object_id=object_id, model=Todolist, template_name="todolists/todolist_confirm_delete.html", -- cgit v1.2.3-24-g4f1b