Only include blog posts in similar posts

This commit is contained in:
Jake Howard 2024-05-30 13:54:52 +01:00
parent d199c3a681
commit f427fc7bb5
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -94,7 +94,9 @@ class BlogPostPage(BaseContentPage):
def get_similar_posts(self) -> models.QuerySet: def get_similar_posts(self) -> models.QuerySet:
try: 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: except BlogPostListPage.DoesNotExist:
return BlogPostPage.objects.none() return BlogPostPage.objects.none()