diff --git a/website/blog/models.py b/website/blog/models.py index dd8289b..5615841 100644 --- a/website/blog/models.py +++ b/website/blog/models.py @@ -79,7 +79,7 @@ class BlogPostPage(BaseContentPage): else models.Value(1), ) - page_tags = list(self.tags.values_list("id", flat=True)) + page_tags = list(self.tags.public().live().values_list("id", flat=True)) similar_posts = similar_posts.alias( # If this page has no tags, ignore it as part of similarity # NB: Cast to a float, because `COUNT` returns a `bigint`. diff --git a/website/blog/tests.py b/website/blog/tests.py index f9006b3..e4883bf 100644 --- a/website/blog/tests.py +++ b/website/blog/tests.py @@ -18,7 +18,7 @@ class BlogPostPageTestCase(TestCase): self.assertEqual(response.status_code, 200) def test_queries(self) -> None: - with self.assertNumQueries(41): + with self.assertNumQueries(43): self.client.get(self.page.url) @@ -76,7 +76,7 @@ class BlogPostListPageTestCase(TestCase): self.assertEqual(len(response.context["listing_pages"]), 2) def test_queries(self) -> None: - with self.assertNumQueries(37): + with self.assertNumQueries(39): self.client.get(self.page.url) def test_feed_accessible(self) -> None: diff --git a/website/common/templates/common/content-details.html b/website/common/templates/common/content-details.html index e99f06b..4f84a6f 100644 --- a/website/common/templates/common/content-details.html +++ b/website/common/templates/common/content-details.html @@ -20,14 +20,14 @@ {% endif %} - {% if page.tags.all %} + {% if page.tags.public.live.all %}