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 --- news/views.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'news') diff --git a/news/views.py b/news/views.py index e6a6d83..2fe3743 100644 --- a/news/views.py +++ b/news/views.py @@ -2,6 +2,7 @@ from django import forms from django.contrib.auth.decorators import permission_required from django.shortcuts import render_to_response, redirect from django.template import RequestContext +from django.views.decorators.cache import never_cache from django.views.generic import list_detail, create_update from main.models import News @@ -23,6 +24,7 @@ class NewsForm(forms.ModelForm): exclude=('id', 'author', 'postdate') @permission_required('main.add_news') +@never_cache def add(request): if request.POST: form = NewsForm(request.POST) @@ -37,6 +39,7 @@ def add(request): RequestContext(request, { 'form': form })) @permission_required('main.delete_news') +@never_cache def delete(request, newsid): return create_update.delete_object(request, News, @@ -46,6 +49,7 @@ def delete(request, newsid): template_object_name='news') @permission_required('main.change_news') +@never_cache def edit(request, newsid): return create_update.update_object(request, object_id=newsid, -- cgit v1.2.3-24-g4f1b