From 1345d5d24f5d12a73af39cd7b41898bc5d25fbf1 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Sat, 3 Oct 2015 20:24:13 +0100 Subject: [PATCH 1/2] Allow "_" GET parameter in the API. Fixes #1671 Used by jQuery for cache-busting --- wagtail/contrib/wagtailapi/endpoints.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wagtail/contrib/wagtailapi/endpoints.py b/wagtail/contrib/wagtailapi/endpoints.py index c6a2489fc..26846d598 100644 --- a/wagtail/contrib/wagtailapi/endpoints.py +++ b/wagtail/contrib/wagtailapi/endpoints.py @@ -37,6 +37,9 @@ class BaseAPIEndpoint(GenericViewSet): 'fields', 'order', 'search', + + # Used by jQuery for cache-busting. See #1671 + '_', ]) extra_api_fields = [] name = None # Set on subclass. From da42620089e7510f8e61105aac3cdf84b770f080 Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Wed, 14 Oct 2015 17:26:03 +0100 Subject: [PATCH 2/2] Release note for #1791 --- CHANGELOG.txt | 1 + docs/releases/1.2.rst | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 9187d3f47..74bae6587 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -29,6 +29,7 @@ Changelog * Fix: Project template no longer raises a deprecation warning (Maximilian Stauss) * Fix: `PageManager.sibling_of(page)` and `PageManager.not_sibling_of(page)` now default to inclusive (i.e. `page` is considered a sibling of itself), for consistency with other sibling methods * Fix: The "view live" button displayed after publishing a page now correctly reflects any changes made to the page slug (Ryan Pineo) + * Fix: API endpoints now accept and ignore the `_` query parameter used by jQuery for cache-busting 1.1 (15.09.2015) diff --git a/docs/releases/1.2.rst b/docs/releases/1.2.rst index b1f482b86..c8a8d9d5e 100644 --- a/docs/releases/1.2.rst +++ b/docs/releases/1.2.rst @@ -65,6 +65,7 @@ Bug fixes * Project template no longer raises a deprecation warning (Maximilian Stauss) * ``PageManager.sibling_of(page)`` and ``PageManager.not_sibling_of(page)`` now default to inclusive (i.e. ``page`` is considered a sibling of itself), for consistency with other sibling methods * The "view live" button displayed after publishing a page now correctly reflects any changes made to the page slug (Ryan Pineo) + * API endpoints now accept and ignore the ``_`` query parameter used by jQuery for cache-busting Upgrade considerations