From d61318503c94110ab644ba88317c166b8633598e Mon Sep 17 00:00:00 2001 From: Ryan Johnson Date: Mon, 5 Aug 2024 11:11:09 -0700 Subject: [PATCH] only use active topics --- kitsune/products/views.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kitsune/products/views.py b/kitsune/products/views.py index 2163ff91ddb..f8a92c7ab59 100644 --- a/kitsune/products/views.py +++ b/kitsune/products/views.py @@ -135,11 +135,15 @@ def document_listing(request, topic_slug, product_slug=None, subtopic_slug=None) Exists(Document.objects.visible(topics=topic, products=OuterRef("pk"))) ) else: - topic = get_object_or_404(Topic, slug=topic_slug, products=product, parent__isnull=True) + topic = get_object_or_404( + Topic.active, slug=topic_slug, products=product, parent__isnull=True + ) product_topics = topics_for(request.user, product=product, parent=None) if subtopic_slug is not None: - subtopic = get_object_or_404(Topic, slug=subtopic_slug, product=product, parent=topic) + subtopic = get_object_or_404( + Topic.active, slug=subtopic_slug, product=product, parent=topic + ) doc_kw["topics"] = [subtopic] doc_kw["topics"] = [topic]