From f55b4fb132dc9a227992ac3af03a6111e1eb03fc Mon Sep 17 00:00:00 2001 From: Nick Moreton Date: Mon, 6 Nov 2023 16:38:49 +0000 Subject: [PATCH 01/23] Add a template for the RedirectPage model This is a workaround for the error that occurs when previewing a RedirectPage in the Wagtail admin. The template is never served on the frontend, but it is required for the preview to work. --- CHANGELOG.md | 2 ++ .../patterns/pages/standardpages/redirect_page.html | 11 +++++++++++ .../patterns/pages/standardpages/redirect_page.yaml | 2 ++ bc/standardpages/models.py | 4 ++++ 4 files changed, 19 insertions(+) create mode 100644 bc/project_styleguide/templates/patterns/pages/standardpages/redirect_page.html create mode 100644 bc/project_styleguide/templates/patterns/pages/standardpages/redirect_page.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index db8af387..d5f9bdb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- Add a template for the RedirectPage type + ## 69.10 (2023-10-24) Compare: diff --git a/bc/project_styleguide/templates/patterns/pages/standardpages/redirect_page.html b/bc/project_styleguide/templates/patterns/pages/standardpages/redirect_page.html new file mode 100644 index 00000000..b1183496 --- /dev/null +++ b/bc/project_styleguide/templates/patterns/pages/standardpages/redirect_page.html @@ -0,0 +1,11 @@ +{% extends base_page_template %} + +{% block content %} +
+
+

Redirect Page preview

+

This is only place holder content.

+

A redirect page is not shown to a site visitor because the redirect will take place before it's displayed.

+
+
+{% endblock %} diff --git a/bc/project_styleguide/templates/patterns/pages/standardpages/redirect_page.yaml b/bc/project_styleguide/templates/patterns/pages/standardpages/redirect_page.yaml new file mode 100644 index 00000000..6d805f46 --- /dev/null +++ b/bc/project_styleguide/templates/patterns/pages/standardpages/redirect_page.yaml @@ -0,0 +1,2 @@ +context: + base_page_template: 'patterns/base_page.html' diff --git a/bc/standardpages/models.py b/bc/standardpages/models.py index 16b57880..ef4da0e2 100644 --- a/bc/standardpages/models.py +++ b/bc/standardpages/models.py @@ -133,6 +133,10 @@ def get_context(self, request, *args, **kwargs): class RedirectPage(BasePage): + # This page type returns a redirect, the template is never served on the frontend. + # In the Wagtail admin, without a template it will throw an error when the preview is opened. + template = "patterns/pages/standardpages/redirect_page.html" + internal_page = models.ForeignKey( "wagtailcore.Page", null=True, From b529a6b5c6fa15cc0939f10762d19697dec6c03a Mon Sep 17 00:00:00 2001 From: Lauren Date: Fri, 10 Nov 2023 13:41:40 +0000 Subject: [PATCH 02/23] Handle IndexError in is_number() method --- bc/utils/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bc/utils/utils.py b/bc/utils/utils.py index e7b1e951..ad6b7697 100644 --- a/bc/utils/utils.py +++ b/bc/utils/utils.py @@ -5,7 +5,7 @@ def is_number(s): try: float(s) return True - except (ValueError, TypeError): + except (IndexError, ValueError, TypeError): return False From 4d1485ca41d1ec232478ca1db0b95a28f8a3a4a5 Mon Sep 17 00:00:00 2001 From: Lauren Date: Wed, 22 Nov 2023 11:01:14 +0000 Subject: [PATCH 03/23] Handle IndexError approriately --- bc/utils/blocks.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/bc/utils/blocks.py b/bc/utils/blocks.py index 93006d24..9d8dfec1 100644 --- a/bc/utils/blocks.py +++ b/bc/utils/blocks.py @@ -457,19 +457,25 @@ def render(self, value, context=None): # Get total value total_value = 0 for row in cleaned_data: - if is_number(row[1]): - total_value += float(row[1]) + try: + if is_number(row[1]): + total_value += float(row[1]) + except IndexError: + pass # Use percentage values for the chart series_data = [] for row in cleaned_data: - if is_number(row[1]): - series_value = round(float(row[1]) / total_value * 100, 1) - else: - series_value = row[1] - series = {"name": row[0], "y": series_value} - series_data.append(series) - row.append(f"{series_value}%") + try: + if is_number(row[1]): + series_value = round(float(row[1]) / total_value * 100, 1) + else: + series_value = row[1] + series = {"name": row[0], "y": series_value} + series_data.append(series) + row.append(f"{series_value}%") + except IndexError: + pass new_value = {"chart": {"type": "pie"}, "series": [{"data": series_data}]} From 57bc6094bff7063b4a06898b161afd8461ba5a5c Mon Sep 17 00:00:00 2001 From: user Date: Mon, 27 Nov 2023 12:42:44 +0000 Subject: [PATCH 04/23] Add some code help to the PieChartBlock --- bc/utils/blocks.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bc/utils/blocks.py b/bc/utils/blocks.py index 9d8dfec1..75b9ab60 100644 --- a/bc/utils/blocks.py +++ b/bc/utils/blocks.py @@ -458,15 +458,23 @@ def render(self, value, context=None): total_value = 0 for row in cleaned_data: try: + # The preview will update when key presses are made, so we need to + # handle the case where the second column has no value. + # When the second column is completed, the preview will update again + # and the total value will be correct. if is_number(row[1]): total_value += float(row[1]) except IndexError: - pass + pass # Fails silently # Use percentage values for the chart series_data = [] for row in cleaned_data: try: + # The preview will update when key presses are made, so we need to + # handle the case where the second column has no value. + # When the second column is completed, the preview will update again + # and the total value will be correct. if is_number(row[1]): series_value = round(float(row[1]) / total_value * 100, 1) else: @@ -475,7 +483,7 @@ def render(self, value, context=None): series_data.append(series) row.append(f"{series_value}%") except IndexError: - pass + pass # Fails silently new_value = {"chart": {"type": "pie"}, "series": [{"data": series_data}]} From 4d07c326f79ad06b285083a63aadf87dd9e0d0cb Mon Sep 17 00:00:00 2001 From: user Date: Mon, 27 Nov 2023 12:47:05 +0000 Subject: [PATCH 05/23] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5f9bdb5..92284503 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased - Add a template for the RedirectPage type +- Add a check for empty columns in the PieChartBlock ## 69.10 (2023-10-24) From 11f57a88da231b663eddfe0b9c56d97c7ef7734c Mon Sep 17 00:00:00 2001 From: user Date: Mon, 27 Nov 2023 12:53:56 +0000 Subject: [PATCH 06/23] Linting --- bc/utils/blocks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bc/utils/blocks.py b/bc/utils/blocks.py index 75b9ab60..c5099caf 100644 --- a/bc/utils/blocks.py +++ b/bc/utils/blocks.py @@ -465,7 +465,7 @@ def render(self, value, context=None): if is_number(row[1]): total_value += float(row[1]) except IndexError: - pass # Fails silently + pass # Fails silently # Use percentage values for the chart series_data = [] @@ -483,7 +483,7 @@ def render(self, value, context=None): series_data.append(series) row.append(f"{series_value}%") except IndexError: - pass # Fails silently + pass # Fails silently new_value = {"chart": {"type": "pie"}, "series": [{"data": series_data}]} From efc6075e4d34abb1d107272e3adba410ca979f75 Mon Sep 17 00:00:00 2001 From: Lauren Date: Fri, 10 Nov 2023 15:16:16 +0000 Subject: [PATCH 07/23] Include ConnectionError handling for area_finder --- bc/area_finder/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bc/area_finder/views.py b/bc/area_finder/views.py index 811b4849..1115038d 100644 --- a/bc/area_finder/views.py +++ b/bc/area_finder/views.py @@ -36,7 +36,7 @@ def area_finder(request): try: resp = client.query_postcode(formatted_postcode) - except (HTTPError, Timeout): + except (HTTPError, Timeout, ConnectionError): return JsonResponse( {"error": "Request failed, try again"}, status=status.HTTP_400_BAD_REQUEST ) From a60c8cbb4f4cbbf4cd24f6b1174e7c0db6f191ac Mon Sep 17 00:00:00 2001 From: Lauren Date: Mon, 13 Nov 2023 14:42:58 +0000 Subject: [PATCH 08/23] Include patch test for ConnectionError --- bc/area_finder/tests/test_views.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bc/area_finder/tests/test_views.py b/bc/area_finder/tests/test_views.py index 24dfb09b..8f130a3d 100644 --- a/bc/area_finder/tests/test_views.py +++ b/bc/area_finder/tests/test_views.py @@ -363,3 +363,12 @@ def test_timeout(self, mock_client): self.assertEqual(resp.headers["content-type"], "application/json") json_response = resp.json() self.assertIn("error", json_response) + + @mock.patch("bc.area_finder.views.BucksMapsClient") + def test_connectionerror(self, mock_client): + mock_client().query_postcode.side_effect = ConnectionError + resp = self.client.get(self.url + "?postcode=W1A+1AA") + self.assertEqual(resp.status_code, 400) + self.assertEqual(resp.headers["content-type"], "application/json") + json_response = resp.json() + self.assertIn("error", json_response) From e48c3aa43fd47d6a523de73fe93f80c8b64ec717 Mon Sep 17 00:00:00 2001 From: Lauren Date: Mon, 20 Nov 2023 10:32:14 +0000 Subject: [PATCH 09/23] Implement automatic retries for failed connections --- bc/area_finder/client.py | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/bc/area_finder/client.py b/bc/area_finder/client.py index d04f78a2..18980413 100644 --- a/bc/area_finder/client.py +++ b/bc/area_finder/client.py @@ -1,6 +1,8 @@ from django.conf import settings -import requests +from requests import Session +from requests.adapters import HTTPAdapter +from urllib3.util import Retry class BucksMapsClient: @@ -42,8 +44,30 @@ class BucksMapsClient: "f": "pjson", } + def __init__(self): + """ + Setting up a session with retries due to Sentry ConnectionError seen in production; + + - backoff_factor is increase in sleep time between retries (10%) + - status_forcelist is the list of status codes to retry on + - allowed_methods is the set of uppercased HTTP method verbs that we should retry on. + + Here we will retry the request 3 times if it fails with a 502, 503 or 504 error + with an increasing length of time between retries. + """ + self.session = Session() + + retries = Retry( + total=3, + backoff_factor=0.1, + status_forcelist=[502, 503, 504], + allowed_methods={"POST"}, + ) + + self.session.mount(self.base_url, adapter=HTTPAdapter(max_retries=retries)) + def _post(self, data): - response = requests.post( + response = self.session.post( self.base_url, data=data, timeout=settings.BUCKS_MAPS_CLIENT_API_TIMEOUT_SECONDS, From 48e20eb8c675a28c72df1838ff098950477bbb80 Mon Sep 17 00:00:00 2001 From: Lauren Date: Wed, 22 Nov 2023 09:26:35 +0000 Subject: [PATCH 10/23] Reimplement retries in post method --- bc/area_finder/client.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/bc/area_finder/client.py b/bc/area_finder/client.py index 18980413..8883db77 100644 --- a/bc/area_finder/client.py +++ b/bc/area_finder/client.py @@ -44,29 +44,27 @@ class BucksMapsClient: "f": "pjson", } - def __init__(self): + def _post(self, data): """ - Setting up a session with retries due to Sentry ConnectionError seen in production; + Set up a session with retries for handling Sentry ConnectionError in production. - - backoff_factor is increase in sleep time between retries (10%) - - status_forcelist is the list of status codes to retry on - - allowed_methods is the set of uppercased HTTP method verbs that we should retry on. + - `backoff_factor`: Increase in sleep time between retries (10%). + - `status_forcelist`: List of status codes to retry on. + - `allowed_methods`: Set of uppercased HTTP method verbs for retries. - Here we will retry the request 3 times if it fails with a 502, 503 or 504 error - with an increasing length of time between retries. + Retry the request 3 times with an increasing delay if it fails with a 502-504, 598 error. """ self.session = Session() retries = Retry( total=3, backoff_factor=0.1, - status_forcelist=[502, 503, 504], + status_forcelist=[502, 503, 504, 598], allowed_methods={"POST"}, ) self.session.mount(self.base_url, adapter=HTTPAdapter(max_retries=retries)) - def _post(self, data): response = self.session.post( self.base_url, data=data, From f67084b69f55ebadec7165447b84a06b5dcb0b8f Mon Sep 17 00:00:00 2001 From: Lauren Date: Wed, 22 Nov 2023 09:30:23 +0000 Subject: [PATCH 11/23] Alter status_code --- bc/area_finder/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bc/area_finder/client.py b/bc/area_finder/client.py index 8883db77..388528fb 100644 --- a/bc/area_finder/client.py +++ b/bc/area_finder/client.py @@ -52,14 +52,14 @@ def _post(self, data): - `status_forcelist`: List of status codes to retry on. - `allowed_methods`: Set of uppercased HTTP method verbs for retries. - Retry the request 3 times with an increasing delay if it fails with a 502-504, 598 error. + Retry the request 3 times with an increasing delay if it fails with a 598 error. """ self.session = Session() retries = Retry( total=3, backoff_factor=0.1, - status_forcelist=[502, 503, 504, 598], + status_forcelist=[598], allowed_methods={"POST"}, ) From 35269b92c969e14be37186063e30091b0fa5c518 Mon Sep 17 00:00:00 2001 From: Lauren Date: Wed, 22 Nov 2023 10:20:00 +0000 Subject: [PATCH 12/23] Move docstring to docs --- bc/area_finder/client.py | 13 +++---------- docs/postcode-lookup.md | 4 ++++ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/bc/area_finder/client.py b/bc/area_finder/client.py index 388528fb..b5699fa2 100644 --- a/bc/area_finder/client.py +++ b/bc/area_finder/client.py @@ -45,21 +45,14 @@ class BucksMapsClient: } def _post(self, data): - """ - Set up a session with retries for handling Sentry ConnectionError in production. - - - `backoff_factor`: Increase in sleep time between retries (10%). - - `status_forcelist`: List of status codes to retry on. - - `allowed_methods`: Set of uppercased HTTP method verbs for retries. - - Retry the request 3 times with an increasing delay if it fails with a 598 error. - """ + # Set up a session with retries for handling Sentry ConnectionError in production + # for further information see documentation at docs/postcode-lookup.md self.session = Session() retries = Retry( total=3, backoff_factor=0.1, - status_forcelist=[598], + status_forcelist=[502, 503, 504, 598], allowed_methods={"POST"}, ) diff --git a/docs/postcode-lookup.md b/docs/postcode-lookup.md index 731da028..6dd70619 100644 --- a/docs/postcode-lookup.md +++ b/docs/postcode-lookup.md @@ -17,3 +17,7 @@ If all the results for a query match a single district council (most queries), w The Python client is at `bc.area_finder.client.BucksMapsClient`. The timeout for the upstream API can be configured with the environment variable: - `BUCKS_MAPS_CLIENT_API_TIMEOUT_SECONDS` (must be parsable as a `float`; defaults to `10`) +- Retries are implemented to handle a Sentry ConnectionError see in production. + - `backoff_factor`: Increase in sleep time between retries (10%). + - `status_forcelist`: List of status codes to retry on. + - `allowed_methods`: Set of uppercased HTTP method verbs for retries. From fe7d4d148b3b4067051c0557f3d36467b8d72fee Mon Sep 17 00:00:00 2001 From: user Date: Mon, 27 Nov 2023 13:14:29 +0000 Subject: [PATCH 13/23] Update change log --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92284503..01f6a2b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Add a template for the RedirectPage type - Add a check for empty columns in the PieChartBlock +- Add a Retry to the BucksMapsClient ## 69.10 (2023-10-24) From f1af349d005f757bcd55c2ef42941829c475057e Mon Sep 17 00:00:00 2001 From: Katherine Domingo Date: Thu, 13 Jul 2023 15:53:08 +0800 Subject: [PATCH 14/23] Bump Wagtail to 5.0, update wagtail package dependencies --- poetry.lock | 104 +++++++++++++++++++++++++++++++------------------ pyproject.toml | 12 +++--- 2 files changed, 73 insertions(+), 43 deletions(-) diff --git a/poetry.lock b/poetry.lock index ce4c7216..429a0336 100644 --- a/poetry.lock +++ b/poetry.lock @@ -840,6 +840,18 @@ files = [ docs = ["furo (>=2023.5.20)", "sphinx (>=7.0.1)", "sphinx-autodoc-typehints (>=1.23,!=1.23.4)"] testing = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "diff-cover (>=7.5)", "pytest (>=7.3.1)", "pytest-cov (>=4.1)", "pytest-mock (>=3.10)", "pytest-timeout (>=2.1)"] +[[package]] +name = "filetype" +version = "1.2.0" +description = "Infer file type and MIME type of any file/buffer. No external dependencies." +category = "main" +optional = false +python-versions = "*" +files = [ + {file = "filetype-1.2.0-py2.py3-none-any.whl", hash = "sha256:7ce71b6880181241cf7ac8697a2f1eb6a8bd9b429f7ad6d27b8db9ba5f1c2d25"}, + {file = "filetype-1.2.0.tar.gz", hash = "sha256:66b56cd6474bf41d8c54660347d37afcc3f7d1970648de365c102ef77548aadb"}, +] + [[package]] name = "flake8" version = "3.7.7" @@ -2123,37 +2135,40 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] name = "virtualenv" version = "20.24.2" description = "Virtual Python Environment builder" +category = "dev" optional = false -python-versions = ">=3.7" +python-versions = ">=3.6" files = [ - {file = "virtualenv-20.24.2-py3-none-any.whl", hash = "sha256:43a3052be36080548bdee0b42919c88072037d50d56c28bd3f853cbe92b953ff"}, - {file = "virtualenv-20.24.2.tar.gz", hash = "sha256:fd8a78f46f6b99a67b7ec5cf73f92357891a7b3a40fd97637c27f854aae3b9e0"}, + {file = "virtualenv-20.17.1-py3-none-any.whl", hash = "sha256:ce3b1684d6e1a20a3e5ed36795a97dfc6af29bc3970ca8dab93e11ac6094b3c4"}, + {file = "virtualenv-20.17.1.tar.gz", hash = "sha256:f8b927684efc6f1cc206c9db297a570ab9ad0e51c16fa9e45487d36d1905c058"}, ] [package.dependencies] -distlib = ">=0.3.7,<1" -filelock = ">=3.12.2,<4" -platformdirs = ">=3.9.1,<4" +distlib = ">=0.3.6,<1" +filelock = ">=3.4.1,<4" +importlib-metadata = {version = ">=4.8.3", markers = "python_version < \"3.8\""} +platformdirs = ">=2.4,<3" [package.extras] -docs = ["furo (>=2023.5.20)", "proselint (>=0.13)", "sphinx (>=7.0.1)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] -test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8)", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10)"] +docs = ["proselint (>=0.13)", "sphinx (>=5.3)", "sphinx-argparse (>=0.3.2)", "sphinx-rtd-theme (>=1)", "towncrier (>=22.8)"] +testing = ["coverage (>=6.2)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=21.3)", "pytest (>=7.0.1)", "pytest-env (>=0.6.2)", "pytest-freezegun (>=0.4.2)", "pytest-mock (>=3.6.1)", "pytest-randomly (>=3.10.3)", "pytest-timeout (>=2.1)"] [[package]] name = "wagtail" -version = "4.2.4" +version = "5.0.2" description = "A Django content management system." +category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "wagtail-4.2.4-py3-none-any.whl", hash = "sha256:93e8d39a14a44099ca620e46613a3a2319b1d10c622dc7f0ff8658807b18190c"}, - {file = "wagtail-4.2.4.tar.gz", hash = "sha256:4bf146194e1725cd4305bf1998f507d46f587e207d609bc2ec73a6c5cce04410"}, + {file = "wagtail-5.0.2-py3-none-any.whl", hash = "sha256:3a31ecced7b433a93c237a3cb6ca628506fa7ec147671555b9fc56e77dbd05bb"}, + {file = "wagtail-5.0.2.tar.gz", hash = "sha256:debd21df87a5db3445d65ffde12ef14e306a24f5ad490150bed556f0c8ead2bb"}, ] [package.dependencies] anyascii = ">=0.1.5" beautifulsoup4 = ">=4.8,<4.12" -Django = ">=3.2,<4.2" +Django = ">=3.2,<4.3" django-filter = ">=2.2,<23" django-modelcluster = ">=6.0,<7.0" django-permissionedforms = ">=0.1,<1.0" @@ -2167,11 +2182,11 @@ openpyxl = ">=3.0.10,<4.0" Pillow = ">=4.0.0,<10.0.0" requests = ">=2.11.1,<3.0" telepath = ">=0.1.1,<1" -Willow = ">=1.4,<1.5" +Willow = ">=1.5,<1.6" [package.extras] docs = ["Sphinx (>=1.5.2)", "myst-parser (==0.18.1)", "pyenchant (>=3.1.1,<4)", "sphinx-autobuild (>=0.6.0)", "sphinx-copybutton (>=0.5,<1.0)", "sphinx-wagtail-theme (==6.0.0)", "sphinxcontrib-spelling (>=5.4.0,<6)"] -testing = ["Jinja2 (>=3.0,<3.2)", "azure-mgmt-cdn (>=12.0,<13.0)", "azure-mgmt-frontdoor (>=1.0,<1.1)", "black (==22.3.0)", "boto3 (>=1.16,<1.17)", "coverage (>=3.7.0)", "curlylint (==0.13.1)", "django-pattern-library (>=0.7,<0.8)", "djhtml (==1.4.13)", "doc8 (==0.8.1)", "elasticsearch (>=5.0,<6.0)", "flake8 (>=3.6.0)", "flake8-assertive (==2.0.0)", "flake8-blind-except (==0.1.1)", "flake8-comprehensions (==3.8.0)", "flake8-print (==5.0.0)", "freezegun (>=0.3.8)", "isort (==5.6.4)", "polib (>=1.1,<2.0)", "python-dateutil (>=2.7)", "pytz (>=2014.7)", "semgrep (==1.3.0)", "wagtail-factories (>=4.0,<5)"] +testing = ["Jinja2 (>=3.0,<3.2)", "azure-mgmt-cdn (>=12.0,<13.0)", "azure-mgmt-frontdoor (>=1.0,<1.1)", "black (==22.3.0)", "boto3 (>=1.16,<1.17)", "coverage (>=3.7.0)", "curlylint (==0.13.1)", "django-pattern-library (>=0.7,<0.8)", "djhtml (==1.5.2)", "doc8 (==0.8.1)", "elasticsearch (>=5.0,<6.0)", "factory-boy (>=3.2)", "flake8 (>=3.6.0)", "flake8-assertive (==2.0.0)", "flake8-blind-except (==0.1.1)", "flake8-comprehensions (==3.8.0)", "flake8-print (==5.0.0)", "freezegun (>=0.3.8)", "isort (==5.6.4)", "polib (>=1.1,<2.0)", "python-dateutil (>=2.7)", "pytz (>=2014.7)", "semgrep (==1.3.0)"] [[package]] name = "wagtail-django-recaptcha" @@ -2179,15 +2194,20 @@ version = "1.0" description = "A simple recaptcha field for Wagtail Form Pages." optional = false python-versions = "*" -files = [ - {file = "wagtail-django-recaptcha-1.0.tar.gz", hash = "sha256:fc177e75da966e9db1dfd9a566c40d30567518d9280b5db4fec4d50a8c853154"}, -] +files = [] +develop = false [package.dependencies] django-recaptcha = "*" [package.extras] -testing = ["coverage (>=4.1.0,<4.2)", "flake8 (>=3.2.0,<3.3)", "isort (==4.2.5)", "tox (>=2.3.1,<2.4)", "wagtail (==2.0)"] +testing = ["coverage (>=6.5.0,<6.6)", "flake8 (>=5.0.4,<5.1)", "isort (>=5.10.1)", "tox (>=3.26.0,<3.27)", "wagtail (>=4.1)"] + +[package.source] +type = "git" +url = "https://github.com/torchbox-forks/wagtail-django-recaptcha" +reference = "support/wagtail-50" +resolved_reference = "2c0e63e6bcb9a6cf0661781d1c6bc6a2ff2b1014" [[package]] name = "wagtail-factories" @@ -2210,27 +2230,27 @@ test = ["coverage (==6.0)", "flake8 (==4.0.0)", "flake8-blind-except (==0.1.1)", [[package]] name = "wagtail-orderable" -version = "1.1.0" +version = "1.2.0" description = "Orderable support for Wagtail" optional = false python-versions = "*" files = [ - {file = "wagtail-orderable-1.1.0.tar.gz", hash = "sha256:7e4486098caf788d752913a070f54ea0657c3d5c0f584ec8e42756f03ac75c2f"}, - {file = "wagtail_orderable-1.1.0-py3-none-any.whl", hash = "sha256:957c87fd1186d726475c5292252327c395a94d2e3f0f34617a1c87f00c3d748a"}, + {file = "wagtail-orderable-1.2.0.tar.gz", hash = "sha256:3355f91d09cd711960a03d83d2783d35b38735da6cd51fc9ab28fdbf635da050"}, + {file = "wagtail_orderable-1.2.0-py3-none-any.whl", hash = "sha256:b1b951013630cfb6ab13b189a51cfcc78faa668f6b3bd8811359b331e2666763"}, ] [package.dependencies] -wagtail = ">=2.15" +wagtail = ">=4.1" [[package]] name = "wagtail-transfer" version = "0.9.1" -description = "Content transfer for Wagtail" +description = "" +category = "main" optional = false python-versions = ">=3.7" -files = [ - {file = "wagtail_transfer-0.9.1-py3-none-any.whl", hash = "sha256:10eff61eadb30d788cee4e59e659b7042ee49dd6831c87e48288026a6125bddb"}, -] +files = [] +develop = false [package.dependencies] wagtail = ">=4.1" @@ -2238,19 +2258,25 @@ wagtail = ">=4.1" [package.extras] docs = ["mkdocs (>=1.0,<1.1)", "mkdocs-material (>=4.6,<4.7)"] +[package.source] +type = "git" +url = "https://github.com/torchbox-forks/wagtail-transfer" +reference = "wagtail-50" +resolved_reference = "379390326f8e0b05aa4677bdc58416da97ee3bd6" + [[package]] name = "wagtailgeowidget" -version = "7.0.0" +version = "8.0.0" description = "Wagtail-Geo-Widget is the complete map solution for your Wagtail site." optional = false python-versions = "*" files = [ - {file = "wagtailgeowidget-7.0.0-py3-none-any.whl", hash = "sha256:bbe60f2c454b373538bd3d5a77c707476235951c0c5e9386694a1f9fc9b0bc03"}, - {file = "wagtailgeowidget-7.0.0.tar.gz", hash = "sha256:90f9654702bcefe39c4ab09d60a624bb3f27ea7bfc38f3ab2d9582903c14efea"}, + {file = "wagtailgeowidget-8.0.0-py3-none-any.whl", hash = "sha256:59eb0c4261c3be92af5a8d3db006c374f38c8a0a84ae3b0b8de51c1370991810"}, + {file = "wagtailgeowidget-8.0.0.tar.gz", hash = "sha256:786bcac1fbb6d1ba8b1918d6292e5164394e8d269c102ae4ee411a18f664d07c"}, ] [package.dependencies] -Wagtail = ">=2.15" +Wagtail = ">=4.1" [package.extras] test = ["factory-boy", "pytest", "pytest-django"] @@ -2337,17 +2363,21 @@ brotli = ["Brotli"] [[package]] name = "willow" -version = "1.4.1" +version = "1.5.1" description = "A Python image library that sits on top of Pillow, Wand and OpenCV" optional = false -python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*" +python-versions = ">=3.7" files = [ - {file = "Willow-1.4.1-py2.py3-none-any.whl", hash = "sha256:fc4042696d090e75aef922fa1ed26d483c764f005b36cf523cf7c34e69d5dd7a"}, - {file = "Willow-1.4.1.tar.gz", hash = "sha256:0df8ff528531e00b48d40bf72ed81beac1dc82f2d42e5bbed4aff0218bef8c0d"}, + {file = "Willow-1.5.1-py3-none-any.whl", hash = "sha256:ffb95732d4729d1a3478407f697b623467d6ebd1da77e0d44c1016bc69825711"}, + {file = "Willow-1.5.1.tar.gz", hash = "sha256:b7a4909110133fdb1e2287592e0673cc255e0286e1cd53427ee68df1c9220c4c"}, ] +[package.dependencies] +defusedxml = ">=0.7,<1.0" +filetype = ">=1.0.10,<1.1.0 || >1.1.0" + [package.extras] -testing = ["Pillow (>=6.0.0,<10.0.0)", "Wand (>=0.6,<1.0)", "mock (>=3.0,<4.0)"] +testing = ["Pillow (>=9.1.0,<11.0.0)", "Wand (>=0.6,<1.0)", "mock (>=3.0,<4.0)", "pillow-heif (>=0.7.0,<1.0.0)"] [[package]] name = "zeep" @@ -2399,5 +2429,5 @@ gunicorn = ["gunicorn"] [metadata] lock-version = "2.0" -python-versions = "~3.8" -content-hash = "f3e0f1aebd8f608212c6e3f7714f7ed5d453e1ffab5f2a386e5d34cb7ad9d3ec" +python-versions = "~3.7" +content-hash = "aaabb1c1edf4ab1e40d6d0a1bd7687e96086300600fa5f9f08642d4423c3ec0e" diff --git a/pyproject.toml b/pyproject.toml index 4b022dab..9991ede0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,12 +27,12 @@ redis = "2.10.6" scout-apm = "2.0.2" tabulate = "0.8.7" urllib3 = "1.26.11" -wagtail = "~4.2" -wagtail-django-recaptcha = "1.0" -wagtail-factories = "^4.0.0" -wagtail-orderable = "1.1.0" -wagtail-transfer = "0.9.1" -wagtailgeowidget = "7.0.0" +wagtail = "~5.0" +wagtail-django-recaptcha = {git = "https://github.com/torchbox-forks/wagtail-django-recaptcha", branch = "support/wagtail-50"} +wagtail-factories = "^4.1.0" +wagtail-orderable = "^1.2.0" +wagtail-transfer = {git = "https://github.com/torchbox-forks/wagtail-transfer", branch = "wagtail-50"} +wagtailgeowidget = "8.0.0" whitenoise = "5.0" zeep = "3.4.0" sentry-sdk = "^1.19.1" From 6ef2a00e3653acc4afe343ad94256023ba26edec Mon Sep 17 00:00:00 2001 From: Katherine Domingo Date: Thu, 13 Jul 2023 16:13:24 +0800 Subject: [PATCH 15/23] Wagtail 5.0 upgrade considerations, fix failing tests --- bc/search/tests/test_search_promotions.py | 3 +-- bc/search/tests/test_search_queries.py | 3 +-- bc/search/views.py | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/bc/search/tests/test_search_promotions.py b/bc/search/tests/test_search_promotions.py index ebaccebf..0eb7c6df 100644 --- a/bc/search/tests/test_search_promotions.py +++ b/bc/search/tests/test_search_promotions.py @@ -1,9 +1,8 @@ from django.test import TestCase, override_settings from django.urls import reverse -from wagtail.contrib.search_promotions.models import SearchPromotion +from wagtail.contrib.search_promotions.models import Query, SearchPromotion from wagtail.models import Page -from wagtail.search.models import Query from bc.home.models import HomePage from bc.standardpages.tests.fixtures import InformationPageFactory diff --git a/bc/search/tests/test_search_queries.py b/bc/search/tests/test_search_queries.py index cbb63891..bde6b0ae 100644 --- a/bc/search/tests/test_search_queries.py +++ b/bc/search/tests/test_search_queries.py @@ -2,10 +2,9 @@ from django.test import RequestFactory, TestCase, override_settings from django.urls import reverse -from wagtail.contrib.search_promotions.models import SearchPromotion +from wagtail.contrib.search_promotions.models import Query, SearchPromotion from wagtail.models import Page, Site from wagtail.search.backends import get_search_backend -from wagtail.search.models import Query from bc.home.models import HomePage from bc.home.tests.fixtures import HomePageFactory diff --git a/bc/search/views.py b/bc/search/views.py index 1c3ec1d8..15a0ae25 100644 --- a/bc/search/views.py +++ b/bc/search/views.py @@ -12,8 +12,8 @@ from django.views.decorators.csrf import csrf_exempt from django.views.generic.base import View +from wagtail.contrib.search_promotions.models import Query from wagtail.models import Page, Site -from wagtail.search.models import Query import backoff import elasticsearch From 81714512405e10275ff8e107ee7830f5fe3af678 Mon Sep 17 00:00:00 2001 From: Katherine Domingo Date: Thu, 13 Jul 2023 16:14:37 +0800 Subject: [PATCH 16/23] Update deprecated revision attribute (Wagtail 3.0 upgrade consideration) --- bc/migration_utils/handlers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bc/migration_utils/handlers.py b/bc/migration_utils/handlers.py index d1f57a38..a6e705a5 100644 --- a/bc/migration_utils/handlers.py +++ b/bc/migration_utils/handlers.py @@ -44,7 +44,7 @@ def handle_page(page, attrs, mapper): def handle_revision(revision, attrs, mapper): - revision_content = json.loads(revision.content_json) + revision_content = revision.content should_save = False for attr in attrs: @@ -57,7 +57,7 @@ def handle_revision(revision, attrs, mapper): if mapped: revision_content[attr] = json.dumps(stream_data) - revision.content_json = json.dumps(revision_content) + revision.content = revision_content if should_save: revision.save() From 0575348af0b2bd4e0c8c63e5f7969227b833f9b5 Mon Sep 17 00:00:00 2001 From: Katherine Domingo Date: Fri, 14 Jul 2023 14:58:56 +0800 Subject: [PATCH 17/23] Replace branch with tag for wagtail package dependencies --- poetry.lock | 2 +- pyproject.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/poetry.lock b/poetry.lock index 429a0336..84a2a5c3 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2430,4 +2430,4 @@ gunicorn = ["gunicorn"] [metadata] lock-version = "2.0" python-versions = "~3.7" -content-hash = "aaabb1c1edf4ab1e40d6d0a1bd7687e96086300600fa5f9f08642d4423c3ec0e" +content-hash = "1de03ac7d55c1dcbab8b2c01a137b3586f79df0e43d2d8af71610cf6b6087feb" diff --git a/pyproject.toml b/pyproject.toml index 9991ede0..be199deb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,10 +28,10 @@ scout-apm = "2.0.2" tabulate = "0.8.7" urllib3 = "1.26.11" wagtail = "~5.0" -wagtail-django-recaptcha = {git = "https://github.com/torchbox-forks/wagtail-django-recaptcha", branch = "support/wagtail-50"} +wagtail-django-recaptcha = {git = "https://github.com/torchbox-forks/wagtail-django-recaptcha", tag = "v1.2rc1"} wagtail-factories = "^4.1.0" wagtail-orderable = "^1.2.0" -wagtail-transfer = {git = "https://github.com/torchbox-forks/wagtail-transfer", branch = "wagtail-50"} +wagtail-transfer = {git = "https://github.com/torchbox-forks/wagtail-transfer", tag = "v0.9.2rc1"} wagtailgeowidget = "8.0.0" whitenoise = "5.0" zeep = "3.4.0" From 0f55e7ff5855793ad9b37c9b03848759378137e1 Mon Sep 17 00:00:00 2001 From: Katherine Domingo Date: Fri, 14 Jul 2023 15:01:01 +0800 Subject: [PATCH 18/23] Update upgrading.md, remove unnecessary temporary css since wagtail-transfer has been updated for Wagtail >= 4.1 --- bc/static_src/vendor/wagtail_transfer/css/modal.css | 4 ---- bc/utils/wagtail_hooks.py | 11 ----------- docs/upgrading.md | 8 -------- 3 files changed, 23 deletions(-) delete mode 100644 bc/static_src/vendor/wagtail_transfer/css/modal.css diff --git a/bc/static_src/vendor/wagtail_transfer/css/modal.css b/bc/static_src/vendor/wagtail_transfer/css/modal.css deleted file mode 100644 index 96568815..00000000 --- a/bc/static_src/vendor/wagtail_transfer/css/modal.css +++ /dev/null @@ -1,4 +0,0 @@ -/* stylelint-disable */ -.modal-content .close.button { - color: #00676a; -} diff --git a/bc/utils/wagtail_hooks.py b/bc/utils/wagtail_hooks.py index c31581ef..251404f2 100644 --- a/bc/utils/wagtail_hooks.py +++ b/bc/utils/wagtail_hooks.py @@ -1,6 +1,5 @@ from django.templatetags.static import static from django.urls import path, reverse -from django.utils.html import format_html from django.utils.safestring import mark_safe from wagtail import hooks @@ -154,16 +153,6 @@ def register_big_text_feature(features): features.register_converter_rule("contentstate", feature_name, db_conversion) -# This style has been added so that the close icon in the modal dialog is visible e.g. not white. -# It can be removed entirely once the package is updated to be compatible with wagtail 4+. -@hooks.register("insert_global_admin_css") -def wagtail_transfer_admin_fix_css(): - return format_html( - '', - static("vendor/wagtail_transfer/css/modal.css"), - ) - - @hooks.register("insert_editor_js") def editor_js(): return mark_safe( diff --git a/docs/upgrading.md b/docs/upgrading.md index 390f7b34..54cb444a 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -2,14 +2,6 @@ This document describes aspects of the system which should be given particular attention when upgrading Wagtail or its dependencies. -## Known technical debt - -Wagtail transfer isn't currently completely compatible with the wagtail version use here. v4.1 - -There is a admin hook in place bc/utils/wagtail_hooks.py (wagtail_transfer_admin_fix_css) to inject some temporary css. - -Once Wagtail transfer is made compatible the template can be removed. - ## Critical paths The following areas of functionality are critical paths for the site which don't have full automated tests and should be checked manually. From 459bbd79f5581d8ea97ffe2f3709b8b1360be7c4 Mon Sep 17 00:00:00 2001 From: Katherine Domingo Date: Mon, 17 Jul 2023 09:07:29 +0800 Subject: [PATCH 19/23] Update upgrading doc to include information about forked Wagtail package dependencies --- docs/upgrading.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/upgrading.md b/docs/upgrading.md index 54cb444a..de991f0b 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -26,3 +26,17 @@ As well as testing the critical paths, these areas of functionality should be ch - This could be code which you know should be checked and possibly removed - e.g. because you've patched something until a fix is merged in a subsequent release. - Any previous fixes which may need to be updated/reapplied on subsequent upgrades - Technical debt which could be affected by an upgrade. + +## Forked Wagtail package dependencies + +As much as possible, we want to use the official releases available on PyPI for the Wagtail package dependencies. + +However, in certain situations, critical fixes and upgrades may be pending approval, merging, or release. +A temporary solution is to fork the package dependency, tag the working branch, and use the tag in the pyproject file. + +The following packages are forked at the time of the latest upgrade (Wagtail 5.0): + +- `wagtail-django-recaptcha` +- `wagtail-transfer` + +Please note that it is important to replace the usage of the git tags in the pyproject.toml file with the official release version from PyPI as soon as it becomes available. This ensures that we maintain compatibility with the official releases and benefit from any subsequent updates and improvements provided by the original package maintainers. From c8be275acf22f2359365e5ad5ee62ddf7bd520f3 Mon Sep 17 00:00:00 2001 From: Katherine Domingo Date: Thu, 20 Jul 2023 14:01:53 +0800 Subject: [PATCH 20/23] Implement the new widget=SlugInput for the slug field --- bc/utils/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bc/utils/models.py b/bc/utils/models.py index 8cf364a2..b0dc1380 100644 --- a/bc/utils/models.py +++ b/bc/utils/models.py @@ -6,6 +6,7 @@ from wagtail import blocks from wagtail.admin.panels import FieldPanel, MultiFieldPanel +from wagtail.admin.widgets.slug import SlugInput from wagtail.contrib.settings.models import BaseSiteSetting, register_setting from wagtail.fields import RichTextField, StreamField from wagtail.models import Orderable, Page @@ -345,7 +346,7 @@ class Meta: [ MultiFieldPanel( [ - FieldPanel("slug"), + FieldPanel("slug", widget=SlugInput), FieldPanel("seo_title"), FieldPanel("show_in_menus"), FieldPanel("search_description"), From 95f76c53b9a1f09642761fb6aecb9407f37b4466 Mon Sep 17 00:00:00 2001 From: Nick Moreton Date: Fri, 29 Sep 2023 17:32:40 +0100 Subject: [PATCH 21/23] Update Wagtail to 5.0.3 plus other dependencies --- poetry.lock | 49 +++++++++++++++++++++++++++---------------------- pyproject.toml | 2 +- 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/poetry.lock b/poetry.lock index 84a2a5c3..52cec3a8 100644 --- a/poetry.lock +++ b/poetry.lock @@ -844,7 +844,6 @@ testing = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "diff-cover (>=7.5)", "p name = "filetype" version = "1.2.0" description = "Infer file type and MIME type of any file/buffer. No external dependencies." -category = "main" optional = false python-versions = "*" files = [ @@ -1238,6 +1237,16 @@ files = [ {file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5bbe06f8eeafd38e5d0a4894ffec89378b6c6a625ff57e3028921f8ff59318ac"}, {file = "MarkupSafe-2.1.3-cp311-cp311-win32.whl", hash = "sha256:dd15ff04ffd7e05ffcb7fe79f1b98041b8ea30ae9234aed2a9168b5797c3effb"}, {file = "MarkupSafe-2.1.3-cp311-cp311-win_amd64.whl", hash = "sha256:134da1eca9ec0ae528110ccc9e48041e0828d79f24121a1a146161103c76e686"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:f698de3fd0c4e6972b92290a45bd9b1536bffe8c6759c62471efaa8acb4c37bc"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:aa57bd9cf8ae831a362185ee444e15a93ecb2e344c8e52e4d721ea3ab6ef1823"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ffcc3f7c66b5f5b7931a5aa68fc9cecc51e685ef90282f4a82f0f5e9b704ad11"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47d4f1c5f80fc62fdd7777d0d40a2e9dda0a05883ab11374334f6c4de38adffd"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1f67c7038d560d92149c060157d623c542173016c4babc0c1913cca0564b9939"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:9aad3c1755095ce347e26488214ef77e0485a3c34a50c5a5e2471dff60b9dd9c"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:14ff806850827afd6b07a5f32bd917fb7f45b046ba40c57abdb636674a8b559c"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8f9293864fe09b8149f0cc42ce56e3f0e54de883a9de90cd427f191c346eb2e1"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-win32.whl", hash = "sha256:715d3562f79d540f251b99ebd6d8baa547118974341db04f5ad06d5ea3eb8007"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-win_amd64.whl", hash = "sha256:1b8dd8c3fd14349433c79fa8abeb573a55fc0fdd769133baac1f5e07abf54aeb"}, {file = "MarkupSafe-2.1.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8e254ae696c88d98da6555f5ace2279cf7cd5b3f52be2b5cf97feafe883b58d2"}, {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cb0932dc158471523c9637e807d9bfb93e06a95cbf010f1a38b98623b929ef2b"}, {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9402b03f1a1b4dc4c19845e5c749e3ab82d5078d16a2a4c2cd2df62d57bb0707"}, @@ -2135,34 +2144,31 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] name = "virtualenv" version = "20.24.2" description = "Virtual Python Environment builder" -category = "dev" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" files = [ - {file = "virtualenv-20.17.1-py3-none-any.whl", hash = "sha256:ce3b1684d6e1a20a3e5ed36795a97dfc6af29bc3970ca8dab93e11ac6094b3c4"}, - {file = "virtualenv-20.17.1.tar.gz", hash = "sha256:f8b927684efc6f1cc206c9db297a570ab9ad0e51c16fa9e45487d36d1905c058"}, + {file = "virtualenv-20.24.2-py3-none-any.whl", hash = "sha256:43a3052be36080548bdee0b42919c88072037d50d56c28bd3f853cbe92b953ff"}, + {file = "virtualenv-20.24.2.tar.gz", hash = "sha256:fd8a78f46f6b99a67b7ec5cf73f92357891a7b3a40fd97637c27f854aae3b9e0"}, ] [package.dependencies] -distlib = ">=0.3.6,<1" -filelock = ">=3.4.1,<4" -importlib-metadata = {version = ">=4.8.3", markers = "python_version < \"3.8\""} -platformdirs = ">=2.4,<3" +distlib = ">=0.3.7,<1" +filelock = ">=3.12.2,<4" +platformdirs = ">=3.9.1,<4" [package.extras] -docs = ["proselint (>=0.13)", "sphinx (>=5.3)", "sphinx-argparse (>=0.3.2)", "sphinx-rtd-theme (>=1)", "towncrier (>=22.8)"] -testing = ["coverage (>=6.2)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=21.3)", "pytest (>=7.0.1)", "pytest-env (>=0.6.2)", "pytest-freezegun (>=0.4.2)", "pytest-mock (>=3.6.1)", "pytest-randomly (>=3.10.3)", "pytest-timeout (>=2.1)"] +docs = ["furo (>=2023.5.20)", "proselint (>=0.13)", "sphinx (>=7.0.1)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] +test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8)", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10)"] [[package]] name = "wagtail" -version = "5.0.2" +version = "5.0.3" description = "A Django content management system." -category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "wagtail-5.0.2-py3-none-any.whl", hash = "sha256:3a31ecced7b433a93c237a3cb6ca628506fa7ec147671555b9fc56e77dbd05bb"}, - {file = "wagtail-5.0.2.tar.gz", hash = "sha256:debd21df87a5db3445d65ffde12ef14e306a24f5ad490150bed556f0c8ead2bb"}, + {file = "wagtail-5.0.3-py3-none-any.whl", hash = "sha256:2e4203661527a6df3d2f446b1bfca33db4682c760efd3e2aa6116ff30e3193d6"}, + {file = "wagtail-5.0.3.tar.gz", hash = "sha256:c07c8df294e1d2c73f62d0624580aa9437bc1419405b3b2b2f1038e58a514848"}, ] [package.dependencies] @@ -2179,14 +2185,14 @@ draftjs-exporter = ">=2.1.5,<3.0" html5lib = ">=0.999,<2" l18n = ">=2018.5" openpyxl = ">=3.0.10,<4.0" -Pillow = ">=4.0.0,<10.0.0" +Pillow = ">=9.1.0,<10.0.0" requests = ">=2.11.1,<3.0" telepath = ">=0.1.1,<1" Willow = ">=1.5,<1.6" [package.extras] docs = ["Sphinx (>=1.5.2)", "myst-parser (==0.18.1)", "pyenchant (>=3.1.1,<4)", "sphinx-autobuild (>=0.6.0)", "sphinx-copybutton (>=0.5,<1.0)", "sphinx-wagtail-theme (==6.0.0)", "sphinxcontrib-spelling (>=5.4.0,<6)"] -testing = ["Jinja2 (>=3.0,<3.2)", "azure-mgmt-cdn (>=12.0,<13.0)", "azure-mgmt-frontdoor (>=1.0,<1.1)", "black (==22.3.0)", "boto3 (>=1.16,<1.17)", "coverage (>=3.7.0)", "curlylint (==0.13.1)", "django-pattern-library (>=0.7,<0.8)", "djhtml (==1.5.2)", "doc8 (==0.8.1)", "elasticsearch (>=5.0,<6.0)", "factory-boy (>=3.2)", "flake8 (>=3.6.0)", "flake8-assertive (==2.0.0)", "flake8-blind-except (==0.1.1)", "flake8-comprehensions (==3.8.0)", "flake8-print (==5.0.0)", "freezegun (>=0.3.8)", "isort (==5.6.4)", "polib (>=1.1,<2.0)", "python-dateutil (>=2.7)", "pytz (>=2014.7)", "semgrep (==1.3.0)"] +testing = ["Jinja2 (>=3.0,<3.2)", "azure-mgmt-cdn (>=12.0,<13.0)", "azure-mgmt-frontdoor (>=1.0,<1.1)", "black (==22.3.0)", "boto3 (>=1.16,<1.17)", "coverage (>=3.7.0)", "curlylint (==0.13.1)", "django-pattern-library (>=0.7,<0.8)", "djhtml (==1.5.2)", "doc8 (==0.8.1)", "elasticsearch (>=5.0,<6.0)", "factory-boy (>=3.2)", "flake8 (>=3.6.0,<6.1)", "flake8-assertive (==2.0.0)", "flake8-blind-except (==0.1.1)", "flake8-comprehensions (==3.8.0)", "flake8-print (==5.0.0)", "freezegun (>=0.3.8)", "isort (==5.6.4)", "polib (>=1.1,<2.0)", "python-dateutil (>=2.7)", "pytz (>=2014.7)", "semgrep (==1.3.0)"] [[package]] name = "wagtail-django-recaptcha" @@ -2206,8 +2212,8 @@ testing = ["coverage (>=6.5.0,<6.6)", "flake8 (>=5.0.4,<5.1)", "isort (>=5.10.1) [package.source] type = "git" url = "https://github.com/torchbox-forks/wagtail-django-recaptcha" -reference = "support/wagtail-50" -resolved_reference = "2c0e63e6bcb9a6cf0661781d1c6bc6a2ff2b1014" +reference = "2.0.0" +resolved_reference = "35975f98176af5d5a2515ec0e9de116e33a37fda" [[package]] name = "wagtail-factories" @@ -2246,7 +2252,6 @@ wagtail = ">=4.1" name = "wagtail-transfer" version = "0.9.1" description = "" -category = "main" optional = false python-versions = ">=3.7" files = [] @@ -2429,5 +2434,5 @@ gunicorn = ["gunicorn"] [metadata] lock-version = "2.0" -python-versions = "~3.7" -content-hash = "1de03ac7d55c1dcbab8b2c01a137b3586f79df0e43d2d8af71610cf6b6087feb" +python-versions = "~3.8" +content-hash = "b70144eea291e117bf0e1c2751fec8e6f005f001c5bfd75939d6f4883e7d09cd" diff --git a/pyproject.toml b/pyproject.toml index be199deb..b2542b6e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ scout-apm = "2.0.2" tabulate = "0.8.7" urllib3 = "1.26.11" wagtail = "~5.0" -wagtail-django-recaptcha = {git = "https://github.com/torchbox-forks/wagtail-django-recaptcha", tag = "v1.2rc1"} +wagtail-django-recaptcha = {git = "https://github.com/torchbox-forks/wagtail-django-recaptcha", tag = "2.0.0"} wagtail-factories = "^4.1.0" wagtail-orderable = "^1.2.0" wagtail-transfer = {git = "https://github.com/torchbox-forks/wagtail-transfer", tag = "v0.9.2rc1"} From f0ef23caf3fc6c8e9f69879d759eebee722b5916 Mon Sep 17 00:00:00 2001 From: user Date: Mon, 27 Nov 2023 13:23:57 +0000 Subject: [PATCH 22/23] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01f6a2b6..ec1c3665 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Add a template for the RedirectPage type - Add a check for empty columns in the PieChartBlock - Add a Retry to the BucksMapsClient +- Upgrade Wagtail to 5.0 ## 69.10 (2023-10-24) From 9f2601299153d8e7dc1443ce5d06cf4f11c14853 Mon Sep 17 00:00:00 2001 From: user Date: Mon, 27 Nov 2023 13:34:24 +0000 Subject: [PATCH 23/23] Update CHANGELOG.md for release 69.11 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec1c3665..03f5a982 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 69.11 (2023-11-27) + - Add a template for the RedirectPage type - Add a check for empty columns in the PieChartBlock - Add a Retry to the BucksMapsClient