From: Brett Parker Date: Mon, 11 Jun 2012 10:34:32 +0000 (+0100) Subject: Only use live items in the rss/atom blog feed X-Git-Url: https://git.sommitrealweird.co.uk/sommitrealweird.git/commitdiff_plain/992930de1234506ede31838a265a776a76e382de?ds=sidebyside 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. --- 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"