Disable plausible on 404 and page protection pages
This commit is contained in:
parent
d85065d914
commit
d52d532d81
5 changed files with 13 additions and 6 deletions
|
@ -4,6 +4,9 @@
|
||||||
|
|
||||||
{% block body_class %}page-404{% endblock %}
|
{% block body_class %}page-404{% endblock %}
|
||||||
|
|
||||||
|
{# Disable Plausible on 404 page #}
|
||||||
|
{% block plausible %}{% endblock %}
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}
|
||||||
Page not found
|
Page not found
|
||||||
{% wagtail_site as current_site %}
|
{% wagtail_site as current_site %}
|
||||||
|
|
|
@ -48,9 +48,10 @@
|
||||||
|
|
||||||
{% block extra_js %}{% endblock %}
|
{% block extra_js %}{% endblock %}
|
||||||
|
|
||||||
|
{% block plausible %}
|
||||||
{% if not request.user.is_authenticated or not request.is_preview %}
|
{% if not request.user.is_authenticated or not request.is_preview %}
|
||||||
{% plausible %}
|
{% plausible %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
|
|
||||||
{% block title %}Password required{% endblock %}
|
{% block title %}Password required{% endblock %}
|
||||||
|
|
||||||
|
{# Disable Plausible on 404 page #}
|
||||||
|
{% block plausible %}{% endblock %}
|
||||||
|
|
||||||
{% block extra_head %}<meta name="robots" content="noindex" />{% endblock %}
|
{% block extra_head %}<meta name="robots" content="noindex" />{% endblock %}
|
||||||
|
|
||||||
{% block main_content %}
|
{% block main_content %}
|
||||||
|
|
|
@ -22,7 +22,7 @@ class Error404PageTestCase(TestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_queries(self) -> None:
|
def test_queries(self) -> None:
|
||||||
with self.assertNumQueries(25):
|
with self.assertNumQueries(21):
|
||||||
self.client.get(self.url)
|
self.client.get(self.url)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ class SearchPageResultsTestCase(TestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_too_high_page(self) -> None:
|
def test_too_high_page(self) -> None:
|
||||||
with self.assertNumQueries(50):
|
with self.assertNumQueries(46):
|
||||||
response = self.client.get(
|
response = self.client.get(
|
||||||
self.url, {"q": "post", "page": 3}, HTTP_HX_REQUEST="true"
|
self.url, {"q": "post", "page": 3}, HTTP_HX_REQUEST="true"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue