From 01e891d0c458b8eaf46fa7ddf19900bfd12c0a31 Mon Sep 17 00:00:00 2001 From: hyden Date: Wed, 8 Mar 2017 22:57:07 +0100 Subject: [PATCH] Convert every Cloudflare API error message into string (#3436) --- CHANGELOG.txt | 1 + CONTRIBUTORS.rst | 1 + docs/releases/1.10.rst | 1 + wagtail/contrib/wagtailfrontendcache/backends.py | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4f7c085fe..2d93469e4 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -25,6 +25,7 @@ Changelog * Fix: IDs used in tabbed interfaces are now namespaced to avoid collisions with other page elements (Janneke Janssen) * Fix: Page title not displaying page name when moving a page (Trent Holliday) * Fix: The ModelAdmin module can now work without the wagtailimages and wagtaildocs apps installed (Andy Babic) + * Fix: Cloudflare error handling now handles non-string error responses correctly (hdnpl) 1.9 (16.02.2017) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 7db542f1e..85b157e5f 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -217,6 +217,7 @@ Contributors * Christine Ho * Trent Holliday * jacoor +* hdnpl Translators =========== diff --git a/docs/releases/1.10.rst b/docs/releases/1.10.rst index de591c56f..3964b7805 100644 --- a/docs/releases/1.10.rst +++ b/docs/releases/1.10.rst @@ -39,6 +39,7 @@ Bug fixes * IDs used in tabbed interfaces are now namespaced to avoid collisions with other page elements (Janneke Janssen) * Page title not displaying page name when moving a page (Trent Holliday) * The ModelAdmin module can now work without the wagtailimages and wagtaildocs apps installed (Andy Babic) + * Cloudflare error handling now handles non-string error responses correctly (hdnpl) Upgrade considerations diff --git a/wagtail/contrib/wagtailfrontendcache/backends.py b/wagtail/contrib/wagtailfrontendcache/backends.py index 0c5877953..22c7f5f0a 100644 --- a/wagtail/contrib/wagtailfrontendcache/backends.py +++ b/wagtail/contrib/wagtailfrontendcache/backends.py @@ -101,7 +101,7 @@ class CloudflareBackend(BaseBackend): return if response_json['success'] is False: - error_messages = ', '.join([err['message'] for err in response_json['errors']]) + error_messages = ', '.join([str(err['message']) for err in response_json['errors']]) logger.error("Couldn't purge '%s' from Cloudflare. Cloudflare errors '%s'", url, error_messages) return