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:
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()