From 1ff2e37e049004852681794537417a1947bf6f18 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 19 Oct 2014 14:19:05 -0500 Subject: Simplify last modified and etags processing for feeds We had this elaborate system set up with caching and invalidation, which is overkill since we cache the result of the view anyway. Just hit the database when needed to find the last change to the respective model class and be done with it. Signed-off-by: Dan McGee --- news/models.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'news') diff --git a/news/models.py b/news/models.py index d51db7c7..985c1088 100644 --- a/news/models.py +++ b/news/models.py @@ -45,12 +45,9 @@ def set_news_fields(sender, **kwargs): news.guid = 'tag:%s,%s:%s' % (Site.objects.get_current(), current_time.strftime('%Y-%m-%d'), news.get_absolute_url()) -# connect signals needed to keep cache in line with reality -from main.utils import refresh_latest -from django.db.models.signals import pre_save, post_save -post_save.connect(refresh_latest, sender=News, - dispatch_uid="news.models") +from django.db.models.signals import pre_save + pre_save.connect(set_news_fields, sender=News, dispatch_uid="news.models") -- cgit v1.2.3-54-g00ecf