From 62d2d78f17b5d4bfd32547ade3aa322df489eb23 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 20 Nov 2024 13:47:15 +0000 Subject: [PATCH] Ensure cloudfront purges are called with lists --- wagtail/contrib/frontend_cache/backends/cloudfront.py | 2 +- wagtail/contrib/frontend_cache/tests.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wagtail/contrib/frontend_cache/backends/cloudfront.py b/wagtail/contrib/frontend_cache/backends/cloudfront.py index f92584222e..45e63c009b 100644 --- a/wagtail/contrib/frontend_cache/backends/cloudfront.py +++ b/wagtail/contrib/frontend_cache/backends/cloudfront.py @@ -72,7 +72,7 @@ class CloudfrontBackend(BaseBackend): paths_by_distribution_id[distribution_id].add(url_parsed.path) for distribution_id, paths in paths_by_distribution_id.items(): - self._create_invalidation(distribution_id, paths) + self._create_invalidation(distribution_id, list(paths)) def purge(self, url): self.purge_batch([url]) diff --git a/wagtail/contrib/frontend_cache/tests.py b/wagtail/contrib/frontend_cache/tests.py index 35881c2a5d..1872e5556a 100644 --- a/wagtail/contrib/frontend_cache/tests.py +++ b/wagtail/contrib/frontend_cache/tests.py @@ -360,7 +360,7 @@ class TestBackendConfiguration(SimpleTestCase): backends.get("cloudfront").purge("http://torchbox.com/blog/") _create_invalidation.assert_called_once_with( - "frontend", {"/home/events/christmas/"} + "frontend", ["/home/events/christmas/"] ) self.assertTrue(