summaryrefslogtreecommitdiffstats
path: root/todolists
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-06-22 19:09:22 +0200
committerDan McGee <dan@archlinux.org>2010-06-22 19:09:22 +0200
commit081ed6c8661bbec81cdbb9029e4832b34805f37b (patch)
treee5e22d2e52453df32aa7f8a3425125efda4b7c25 /todolists
parent4c96b53f2ed9551028457ad6e0b26692c3cf385b (diff)
downloadarchweb-081ed6c8661bbec81cdbb9029e4832b34805f37b.tar.gz
archweb-081ed6c8661bbec81cdbb9029e4832b34805f37b.tar.xz
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 <dan@archlinux.org>
Diffstat (limited to 'todolists')
-rw-r--r--todolists/views.py4
1 files changed, 4 insertions, 0 deletions
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",