From f427fc7bb58c125ee0af6eaab9bd1c05d7cfab6f Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 30 May 2024 13:54:52 +0100 Subject: [PATCH] Only include blog posts in similar posts --- website/blog/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/blog/models.py b/website/blog/models.py index 1bd57c5..f743a57 100644 --- a/website/blog/models.py +++ b/website/blog/models.py @@ -94,7 +94,9 @@ class BlogPostPage(BaseContentPage): def get_similar_posts(self) -> models.QuerySet: try: - listing_pages = BlogPostListPage.objects.get().get_listing_pages() + listing_pages = BlogPostPage.objects.filter( + id__in=BlogPostListPage.objects.get().get_listing_pages() + ) except BlogPostListPage.DoesNotExist: return BlogPostPage.objects.none()