From 92c6a46857f237aa906bac82e5b3a301a5a0b060 Mon Sep 17 00:00:00 2001 From: Serghei Mihai Date: Mon, 5 Dec 2016 16:00:50 +0100 Subject: [PATCH 2/4] display only published announces in RSS feed --- corbo/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/corbo/views.py b/corbo/views.py index 530dfac..d0ff15f 100644 --- a/corbo/views.py +++ b/corbo/views.py @@ -202,7 +202,8 @@ class AtomView(Feed): self.__dict__.update(kwargs) def items(self): - return models.Announce.objects.exclude(expiration_time__lt=datetime.now()).order_by('-publication_time') + return models.Announce.objects.exclude(publication_time__isnull=False, + expiration_time__lt=datetime.now()).order_by('-publication_time') def item_title(self, item): return item.title @@ -214,7 +215,7 @@ class AtomView(Feed): return self.feed_item_link_template.format(item.pk) def item_pubdate(self, item): - return item.publication_time or item.mtime + return item.publication_time atom = AtomView() -- 2.11.0