From 1cd35a6aae46c044c9e1b2b3ce80160e9060a14f Mon Sep 17 00:00:00 2001 From: smith Date: Thu, 13 Feb 2025 15:55:59 -0500 Subject: [PATCH] Exclude AAQ macro on the get-community-support page (#6481) * Exclude AAQ macro on the get-community-support page * Add visibility check to view * Ensure parent check to handle translations --- kitsune/wiki/jinja2/wiki/document.html | 4 +++- kitsune/wiki/views.py | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/kitsune/wiki/jinja2/wiki/document.html b/kitsune/wiki/jinja2/wiki/document.html index 972f3ed89ac..9403920dee6 100644 --- a/kitsune/wiki/jinja2/wiki/document.html +++ b/kitsune/wiki/jinja2/wiki/document.html @@ -56,7 +56,9 @@ {{ search_box(settings, id='support-search-sidebar', params=search_params) }} - {{ aaq_widget(request) }} + {% if show_aaq_widget %} + {{ aaq_widget(request) }} + {% endif %} {% if fallback_reason == 'no_translation' %} {# If there is no translation, there is no document and the (future) parent is document. #} diff --git a/kitsune/wiki/views.py b/kitsune/wiki/views.py index 8d5dcc715e5..5c60093b584 100644 --- a/kitsune/wiki/views.py +++ b/kitsune/wiki/views.py @@ -304,6 +304,11 @@ def maybe_vary_on_accept_language(response): is_first_revision = doc.revisions.filter(is_approved=True).count() == 1 + show_aaq_widget = ( + not (doc.parent and doc.parent.slug == "get-community-support") + and doc.slug != "get-community-support" + ) + data = { "document": doc, "is_first_revision": is_first_revision, @@ -318,6 +323,7 @@ def maybe_vary_on_accept_language(response): "ga_products": ga_products, "ga_article_locale": ga_article_locale, "related_products": doc.related_products.exclude(pk=product.pk), + "show_aaq_widget": show_aaq_widget, "breadcrumb_items": breadcrumbs, "document_css_class": document_css_class, "any_localizable_revision": any_localizable_revision,