Update to Wagtail 4.1

This commit is contained in:
Jake Howard 2023-04-16 15:04:51 +01:00
parent 9bc5ccbbdc
commit f055517cc1
Signed by: jake
GPG key ID: 57AFB45680EDD477
7 changed files with 47 additions and 13 deletions

View file

@ -1,5 +1,6 @@
@weekly ./manage.py update_index
@daily ./manage.py clearsessions
@daily ./manage.py update_unsplash_photos
@daily ./manage.py rebuild_references_index
@weekly ./manage.py refresh_spotify_playlists
*/10 * * * * ./manage.py publish_scheduled_pages

View file

@ -1,27 +1,26 @@
Django==4.0.10
wagtail==3.0.3
wagtail==4.1.4
django-environ==0.9.0
whitenoise[brotli]==6.4.0
Pygments==2.14.0
beautifulsoup4==4.9.3
Pygments==2.15.0
beautifulsoup4==4.11.2
lxml==4.9.1
requests==2.28.1
wagtail-generic-chooser==0.5
wagtail-generic-chooser==0.5.1
django-rq==2.7.0
django-redis==5.2.0
wagtail-draftail-snippet==0.4.2
gunicorn==20.1.0
psycopg2==2.9.5
djangorestframework
django-htmx==1.14.0
wagtail-metadata==4.0.2
wagtail-metadata==4.0.3
humanize==4.6.0
django-plausible==0.4.0
sentry-sdk==1.15.0
django-sri==0.5.0
wagtail-2fa==1.6.3
wagtail-2fa==1.6.5
django-health-check==3.17.0
wagtail-autocomplete==0.9.0
wagtail-autocomplete==0.10.0
Wand==0.6.10
django3-cache-decorator==0.5.2
django-cors-headers==3.14.0
@ -36,3 +35,6 @@ PyYAML
# Use custom `wagtail-favicon` with performance improvements
git+https://github.com/RealOrangeOne/wagtail-favicon@4586efaac746085338fc7d61713006d9adc62d2e
# Use custom `wagtail-draftail-snippet` with support for Wagtail 4.1
git+https://github.com/RealOrangeOne/wagtail-draftail-snippet@0924ab12b1ca205b94ccd9a34ecc446d7ac422e5

View file

@ -0,0 +1,30 @@
# Generated by Django 4.0.10 on 2023-04-16 13:49
import wagtail.fields
import wagtail.snippets.blocks
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("common", "0003_alter_contentpage_body_alter_listingpage_body"),
]
operations = [
migrations.AlterField(
model_name="footersetting",
name="icons",
field=wagtail.fields.StreamField(
[
(
"icon",
wagtail.snippets.blocks.SnippetChooserBlock(
"contact.OnlineAccount", icon="user"
),
)
],
use_json_field=True,
),
),
]

View file

@ -266,7 +266,8 @@ class ReferralLink(models.Model, index.Indexed):
@register_setting(icon="arrow-down")
class FooterSetting(BaseSetting):
icons = StreamField(
[("icon", SnippetChooserBlock("contact.OnlineAccount", icon="user"))]
[("icon", SnippetChooserBlock("contact.OnlineAccount", icon="user"))],
use_json_field=True,
)
panels = [FieldPanel("icons")]

View file

@ -35,7 +35,7 @@ class ContentPageTestCase(TestCase):
self.assertEqual(response.status_code, 200)
def test_queries(self) -> None:
with self.assertNumQueries(34):
with self.assertNumQueries(40):
self.client.get(self.page.url)
@ -52,7 +52,7 @@ class ListingPageTestCase(TestCase):
ContentPageFactory(parent=cls.page)
def test_accessible(self) -> None:
with self.assertNumQueries(38):
with self.assertNumQueries(44):
response = self.client.get(self.page.url)
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.context["listing_pages"]), 2)

View file

@ -22,7 +22,7 @@ class Error404PageTestCase(TestCase):
)
def test_queries(self) -> None:
with self.assertNumQueries(21):
with self.assertNumQueries(27):
self.client.get(self.url)

View file

@ -89,7 +89,7 @@ class SearchPageResultsTestCase(TestCase):
)
def test_too_high_page(self) -> None:
with self.assertNumQueries(46):
with self.assertNumQueries(52):
response = self.client.get(
self.url, {"q": "post", "page": 3}, HTTP_HX_REQUEST="true"
)