From: Frédéric Péters Date: Sun, 17 Dec 2023 16:44:57 +0000 (+0100) Subject: do not include non-feed posts on homepage X-Git-Url: https://git.0d.be/?p=chloro.git;a=commitdiff_plain;h=HEAD do not include non-feed posts on homepage --- diff --git a/chloro/phyll/views.py b/chloro/phyll/views.py index 2a30215..a7f45e7 100644 --- a/chloro/phyll/views.py +++ b/chloro/phyll/views.py @@ -84,8 +84,12 @@ class HomeView(TemplateView): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) - context['posts'] = Note.objects.filter(published=True).order_by('-creation_timestamp')[:5] - context['recent_changes'] = Note.objects.filter(published=True).order_by('-last_update_timestamp') + context['posts'] = Note.objects.filter(published=True, included_in_feed=True).order_by( + '-creation_timestamp' + )[:5] + context['recent_changes'] = Note.objects.filter(published=True, included_in_feed=True).order_by( + '-last_update_timestamp' + ) context['index'] = Note.objects.filter(slug='index').first() return context