From 992930de1234506ede31838a265a776a76e382de Mon Sep 17 00:00:00 2001 From: Brett Parker Date: Mon, 11 Jun 2012 11:34:32 +0100 Subject: [PATCH 1/1] Only use live items in the rss/atom blog feed - Add a filter to check that islive is set to true for blog entries, and only display them if that is the case. --- sommitrealweird/blog/feeds.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sommitrealweird/blog/feeds.py b/sommitrealweird/blog/feeds.py index 69eb81f..064f22a 100644 --- a/sommitrealweird/blog/feeds.py +++ b/sommitrealweird/blog/feeds.py @@ -13,9 +13,9 @@ class LatestBlogEntriesRss(Feed): def items(self): try: - return BlogEntry.objects.all().order_by('-publish_date')[:20] + return BlogEntry.objects.filter(islive=True).order_by('-publish_date')[:20] except: - return BlogEntry.objects.all().order_by('-publish_date') + return BlogEntry.objects.filter(islive=True).order_by('-publish_date') def author_name(self, obj): return "Brett Parker" -- 2.39.5