Merge pull request #6168 from escattone/fix-1931

only use active topics
This commit is contained in:
Tasos Katsoulas 2024-08-06 13:47:50 +03:00 коммит произвёл GitHub
Родитель 87448ca01c d61318503c
Коммит 0c394c5752
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -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]