wagtail 7.0.1__py3-none-any.whl → 7.0.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2139,6 +2139,31 @@ class TestPageEdit(WagtailTestUtils, TestCase):
2139
2139
  html=True,
2140
2140
  )
2141
2141
 
2142
+ def test_edit_alias_page_from_draft_page(self):
2143
+ # Ensure we have at least one revision. This is what happens when creating
2144
+ # a page via the admin. It is stored as latest_revision
2145
+ self.unpublished_page.save_revision()
2146
+ alias_page = self.unpublished_page.create_alias(update_slug="an-alias-page")
2147
+ response = self.client.get(
2148
+ reverse("wagtailadmin_pages:edit", args=[alias_page.id])
2149
+ )
2150
+
2151
+ self.assertEqual(response.status_code, 200)
2152
+ self.assertEqual(response["Content-Type"], "text/html; charset=utf-8")
2153
+
2154
+ self.assertNotContains(response, 'id="status-sidebar-live"')
2155
+
2156
+ # Check the edit_alias.html template was used instead
2157
+ self.assertTemplateUsed(response, "wagtailadmin/pages/edit_alias.html")
2158
+ original_page_edit_url = reverse(
2159
+ "wagtailadmin_pages:edit", args=[self.unpublished_page.id]
2160
+ )
2161
+ self.assertContains(
2162
+ response,
2163
+ f'<a class="button button-secondary" href="{original_page_edit_url}">Edit original page</a>',
2164
+ html=True,
2165
+ )
2166
+
2142
2167
  def test_post_edit_alias_page(self):
2143
2168
  alias_page = self.child_page.create_alias(update_slug="new-child-page")
2144
2169
 
@@ -93,6 +93,8 @@ class AbstractFormField(Orderable):
93
93
  field_type = models.CharField(
94
94
  verbose_name=_("field type"), max_length=16, choices=FORM_FIELD_CHOICES
95
95
  )
96
+ # field_type must be populated for previews to build the form field.
97
+ field_type.required_on_save = True
96
98
  required = models.BooleanField(verbose_name=_("required"), default=True)
97
99
  choices = models.TextField(
98
100
  verbose_name=_("choices"),
@@ -2266,6 +2266,29 @@ class TestPreview(WagtailTestUtils, TestCase):
2266
2266
  self.assertEqual(response.status_code, 200)
2267
2267
  self.assertTemplateUsed(response, template)
2268
2268
 
2269
+ def test_empty_field_type_does_not_crash_preview(self):
2270
+ preview_url = reverse(
2271
+ "wagtailadmin_pages:preview_on_add",
2272
+ args=("tests", "formpage", self.homepage.pk),
2273
+ )
2274
+
2275
+ response = self.client.post(
2276
+ preview_url,
2277
+ {**self.post_data, "form_fields-0-field_type": ""},
2278
+ )
2279
+ self.assertEqual(response.status_code, 200)
2280
+ self.assertJSONEqual(
2281
+ response.content.decode(),
2282
+ {"is_valid": False, "is_available": False},
2283
+ )
2284
+
2285
+ response = self.client.get(preview_url)
2286
+
2287
+ self.assertContains(
2288
+ response,
2289
+ "Preview cannot display due to validation errors.",
2290
+ )
2291
+
2269
2292
 
2270
2293
  class TestFormPageCreate(WagtailTestUtils, TestCase):
2271
2294
  def setUp(self):
@@ -639,11 +639,10 @@ class TestFormatFilter(TestCase):
639
639
  )
640
640
 
641
641
  f = BytesIO()
642
- with patch("PIL.Image.Image.save") as save:
642
+ with patch("willow.plugins.pillow.PillowImage.save_as_avif") as save_as_avif:
643
643
  fil.run(image, f)
644
644
 
645
- # quality=80 is default for The Willow and PIL libraries
646
- save.assert_called_with(f, "AVIF", quality=-1, chroma=444)
645
+ save_as_avif.assert_called_with(f, lossless=True)
647
646
 
648
647
  def test_jpeg(self):
649
648
  fil = Filter(spec="width-400|format-jpeg")
@@ -0,0 +1,45 @@
1
+ from django.db import connection, migrations
2
+
3
+ # This migration takes on the base model defined in 0005_create_indexentry and adds certain fields that are specific to each database system
4
+ class Migration(migrations.Migration):
5
+
6
+ dependencies = [
7
+ ("wagtailsearch", "0008_remove_query_and_querydailyhits_models"),
8
+ ]
9
+
10
+ # Reverse the usage of ngram parser with MySQL introduced in
11
+ # ``0006_customise_indexentry.py``.
12
+ #
13
+ # Ngram parser is designed primarily for languages which to not use spaces to
14
+ # delimit words (most commonly CJK languages). When using ngram with English or
15
+ # other non-CJK languages, it has the adverse affect of parsing words into
16
+ # non-sensical queries that return no results. MySQL default ngram token size is 2
17
+ # characters, so for example the word "wagtail" would be parsed into 6 separate
18
+ # words as follows":
19
+ #
20
+ # "wa" "ag" "gt" "ta" "ai" "il"
21
+ #
22
+ # In English, these tokens would provide useless search results, and in most cases,
23
+ # no results are returned at all when using autocomplete from the Wagtail admin.
24
+ #
25
+ # See: https://dev.mysql.com/doc/refman/8.0/en/fulltext-search-ngram.html
26
+ if connection.vendor == "mysql" and not connection.mysql_is_mariadb:
27
+ operations = [
28
+ migrations.RunSQL(
29
+ sql="""
30
+ ALTER TABLE wagtailsearch_indexentry
31
+ DROP INDEX `fulltext_autocomplete`;
32
+
33
+ ALTER TABLE wagtailsearch_indexentry
34
+ ADD FULLTEXT INDEX `fulltext_autocomplete` (`autocomplete`);
35
+ """,
36
+ reverse_sql="""
37
+ ALTER TABLE wagtailsearch_indexentry
38
+ DROP INDEX `fulltext_autocomplete`;
39
+
40
+ ALTER TABLE wagtailsearch_indexentry
41
+ ADD FULLTEXT INDEX `fulltext_autocomplete` (`autocomplete`)
42
+ WITH PARSER ngram;
43
+ """,
44
+ )
45
+ ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wagtail
3
- Version: 7.0.1
3
+ Version: 7.0.3
4
4
  Summary: A Django content management system.
5
5
  Author-email: Wagtail core team + contributors <hello@wagtail.org>
6
6
  License-Expression: BSD-3-Clause
@@ -41,7 +41,7 @@ Requires-Dist: django-filter>=23.3
41
41
  Requires-Dist: draftjs_exporter<6.0,>=2.1.5
42
42
  Requires-Dist: Pillow<12.0.0,>=9.1.0
43
43
  Requires-Dist: beautifulsoup4<5,>=4.8
44
- Requires-Dist: Willow[heif]<2,>=1.10.0
44
+ Requires-Dist: Willow[heif]<2,>=1.11.0
45
45
  Requires-Dist: requests<3.0,>=2.11.1
46
46
  Requires-Dist: openpyxl<4.0,>=3.0.10
47
47
  Requires-Dist: anyascii>=0.1.5
@@ -1,4 +1,4 @@
1
- wagtail/__init__.py,sha256=DQhT861vbs-upaIFVuUVU3ANCGP9p-NCCiJ_yExHBzk,724
1
+ wagtail/__init__.py,sha256=plTBp9KVUfCxSE2pmAYPUlo_aSdeUb2joH8W5Vkel8g,724
2
2
  wagtail/apps.py,sha256=38kXTdHoQzFnpUqDNxFpsqn2dut4V0u9rLOkhqCoYkc,713
3
3
  wagtail/compat.py,sha256=5z6X9d-h_VUFt44kuZ-Cw00e9Be5vIXy7yqAdfuv3Mc,1452
4
4
  wagtail/coreutils.py,sha256=MbFcVZjqUChdHMCa993X_RUwLJQNUGwpkTpzJOFdtgU,19822
@@ -26,7 +26,7 @@ wagtail/actions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
26
  wagtail/actions/convert_alias.py,sha256=90Srd5WgLr2psSSiKp4zScaKCpNGR12-vnG-gvXaG68,1994
27
27
  wagtail/actions/copy_for_translation.py,sha256=zNBjP2sKno6_bkilUPKho0LQLBHGLS8CCs-Hl4zaPn4,8346
28
28
  wagtail/actions/copy_page.py,sha256=xhLfIMWD_ip3L15hnYyBjRj2mbbi1AFsZircHR5ePYg,14203
29
- wagtail/actions/create_alias.py,sha256=s1nVgQ9d6KhrfbJ3v8AYpPG2qR05_VcduPvTKcMx3fI,9344
29
+ wagtail/actions/create_alias.py,sha256=CkpxyH3TdfVMY9O7NGQ5Ox0vRvv96Ggyt_E8GdOHNyg,9417
30
30
  wagtail/actions/delete_page.py,sha256=5S8bMRd25tOWkN4GsxWW-ligUZ4Elfg1QGw3l6NzOsY,1977
31
31
  wagtail/actions/move_page.py,sha256=UMEBvOCvSnJCbtuh_85O4HHi-tI80Z9tV7N9V4bVfWU,3811
32
32
  wagtail/actions/publish_page_revision.py,sha256=vPKzI8x7N0qEjhgnZJaieBRj9C2lNwANDOWuYpctGgo,2077
@@ -389,7 +389,7 @@ wagtail/admin/static/wagtailadmin/js/chooser-modal.js,sha256=xsI0wn2M1JTtvlIPZ2g
389
389
  wagtail/admin/static/wagtailadmin/js/chooser-widget-telepath.js,sha256=0myTII_jGu4g320xO_a9DVtKNoNWVetFmJYdg4khxYg,1589
390
390
  wagtail/admin/static/wagtailadmin/js/chooser-widget.js,sha256=6QeU2LKqS3m9bYTd6MqNrSSgM0NeuRu1xK7ZxKff8-U,1546
391
391
  wagtail/admin/static/wagtailadmin/js/comments.js,sha256=gPwkL6uNj8waKN_Q4H6q4lQbTdSnO_oRkewEFBMU8OE,50463
392
- wagtail/admin/static/wagtailadmin/js/core.js,sha256=aQqlhCdxkQAKfufp5_oYCMnlUcvsHrNPVv1mYGs4-jY,669369
392
+ wagtail/admin/static/wagtailadmin/js/core.js,sha256=amGBXv_ckUxeixNMEThNShhTWnfPmxRGmJAYNakuTKQ,669382
393
393
  wagtail/admin/static/wagtailadmin/js/core.js.LICENSE.txt,sha256=sKbCnxKnzkZQ7Id26iMCn_-jm0zMDH0HG0Arzopv7og,452
394
394
  wagtail/admin/static/wagtailadmin/js/date-time-chooser.js,sha256=3hETl9qsULtkBwcnuZRFLahg4YggsY0xUeDD6SZUEYw,3376
395
395
  wagtail/admin/static/wagtailadmin/js/draftail.js,sha256=9_w3b62X8f1NRMgkRq6MUA1B-i4zpqXJ2SLy3QdrF4k,294221
@@ -904,7 +904,7 @@ wagtail/admin/tests/pages/test_copy_page.py,sha256=-qfT9KRSu5vomPuW2dTse4mbcsXy3
904
904
  wagtail/admin/tests/pages/test_create_page.py,sha256=xSdisgdJSOKqxK8HjAQw4toNvRFifgcPTXhibCUTut0,96402
905
905
  wagtail/admin/tests/pages/test_custom_listing.py,sha256=ceRddRVNYjiDDz8XDVxQ4JbkYhhnJMnob19VGFTPl3c,1584
906
906
  wagtail/admin/tests/pages/test_delete_page.py,sha256=wUMM2UJNPbrNjdt_x-pxbxEDdUp6FKAWH6SpErd4Uhw,15415
907
- wagtail/admin/tests/pages/test_edit_page.py,sha256=gKS0bdh_1D6Qxi2JeAHK4bJ_Vm-tFwNTeRKBMsKOclE,157527
907
+ wagtail/admin/tests/pages/test_edit_page.py,sha256=d7AfWDIkhzF-LI33gCcsa_2IGfY6HvUg6uFcya8Hi3w,158631
908
908
  wagtail/admin/tests/pages/test_explorer_view.py,sha256=0v2LwLdBjU3vXUGJfusnNOI88KKBXUqOd6h0TexGMLE,58960
909
909
  wagtail/admin/tests/pages/test_move_page.py,sha256=2i5SgVwIszymMlMoi3niTIKwExtexbDIwStbS9PfdI4,10176
910
910
  wagtail/admin/tests/pages/test_page_locking.py,sha256=7CMYaBVzbvSdsLMtXNOoVYnG0iSf7RMedFmGMRdguf8,11766
@@ -1056,7 +1056,7 @@ wagtail/contrib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1056
1056
  wagtail/contrib/forms/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1057
1057
  wagtail/contrib/forms/apps.py,sha256=OY2eHr8Jetf9FYnTTcfWX4XgiG_gWfSGS7ndwMuq5po,285
1058
1058
  wagtail/contrib/forms/forms.py,sha256=l6acbaXKeeks-pcb6iUMb1XsWGqyQ8EIiwUm1ft2VH4,9735
1059
- wagtail/contrib/forms/models.py,sha256=IqLRh9a9W0hDsO2HUgwfAOUzKWqeaTMvP-KT8VLWVHM,12069
1059
+ wagtail/contrib/forms/models.py,sha256=T2_mI0MPiHIId4GZYmJGSwhbaDnnHBSND-EfcVgN5nQ,12181
1060
1060
  wagtail/contrib/forms/panels.py,sha256=zI3bFM1X5iT_fnxQUe5BWWN5iQKm6tEFEiaFhNRZcwk,1556
1061
1061
  wagtail/contrib/forms/urls.py,sha256=VZ4LDq6SkdEi3iXL7zoxDRSNZeGS5ZSeiNUsfqZ-nOI,776
1062
1062
  wagtail/contrib/forms/utils.py,sha256=Gu3WS-X37KQeDuHZliEwkhHJaqDgUwF1ObuVp3ai2fM,1279
@@ -1194,7 +1194,7 @@ wagtail/contrib/forms/templates/wagtailforms/panels/form_responses_panel.html,sh
1194
1194
  wagtail/contrib/forms/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1195
1195
  wagtail/contrib/forms/tests/test_forms.py,sha256=pyTRQjBW9tIInrxnV1_Zy5ACsNTpUlF6SnAfcgOAUWk,16094
1196
1196
  wagtail/contrib/forms/tests/test_models.py,sha256=lcifi_nJHHD9toYVtIY3P-zh-rdCTsLQTgxvAyFKbMM,32465
1197
- wagtail/contrib/forms/tests/test_views.py,sha256=3kqxz-Tp4vtn2vQ4jDgb2B9XbiUlY0lOAa9sEhhoNLw,90917
1197
+ wagtail/contrib/forms/tests/test_views.py,sha256=hRyzalYKmZHnIvoNSioaS4a1AIOzYtHbNc692bUs-ww,91625
1198
1198
  wagtail/contrib/forms/tests/utils.py,sha256=OESefxdqGRgL1lDItVPSFNw_FJNB4X0PvozdvAhrpkc,6043
1199
1199
  wagtail/contrib/frontend_cache/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1200
1200
  wagtail/contrib/frontend_cache/apps.py,sha256=y-TyHADOpdCrIQ7zfnVD6OOxjo28lnBhPJeBtjlPih4,407
@@ -2683,7 +2683,7 @@ wagtail/images/tests/test_admin_views.py,sha256=9Kc0020T69osyZDuzwksPgOWg2YcuO62
2683
2683
  wagtail/images/tests/test_api_fields.py,sha256=CgCLk6PcIwXH4qcT9mBdsn43luD2CAiVZ6j4mxVadyQ,971
2684
2684
  wagtail/images/tests/test_blocks.py,sha256=THgO4HuIjzYk8ZqyunrDG1d1KWpB_ihEy7z9WYtFo0I,18485
2685
2685
  wagtail/images/tests/test_form_overrides.py,sha256=3MlQ9ROurqKphajUT1_VPaH1aE6HCdfwYVzAFCHB9D8,3405
2686
- wagtail/images/tests/test_image_operations.py,sha256=lu9fwD_-pZiNw-TDDPgTEAVXEOiBSowkiDUaCnhAu4g,33287
2686
+ wagtail/images/tests/test_image_operations.py,sha256=obwfuMF0-_1Ig5fiLEjGpjitcuJbmNiNkn7sCxsq3QI,33247
2687
2687
  wagtail/images/tests/test_jinja2.py,sha256=DiSjE4eGq9Nzc17-1L7I2Go8g4kmX50gpIekZPlpld4,16779
2688
2688
  wagtail/images/tests/test_management_commands.py,sha256=8wRNUBko1ERpn7JOlbWQ2lgYgyvHoB11sDgb1eE4LXU,5712
2689
2689
  wagtail/images/tests/test_models.py,sha256=UbEy4R9HImeMsWoZBTa7HJebQ4HPxMBLVpxOKYqW-2g,54169
@@ -3245,6 +3245,7 @@ wagtail/search/migrations/0005_create_indexentry.py,sha256=LvR4mCvqrfEx-tFnOQaUJ
3245
3245
  wagtail/search/migrations/0006_customise_indexentry.py,sha256=ByuG7ERoyCt5e5-4UyGCwdHDOg0NHXnJdkRI8ioJxXw,10677
3246
3246
  wagtail/search/migrations/0007_delete_editorspick.py,sha256=SUF8_SlrLmDLdncz3LngkR_5oMyR5UvPOzRjim5c93o,710
3247
3247
  wagtail/search/migrations/0008_remove_query_and_querydailyhits_models.py,sha256=NCBdecSK8K7Z4g1KpKpuOw4_4SlzaxZf9rVE_o6PPik,608
3248
+ wagtail/search/migrations/0009_remove_ngram_autocomplete.py,sha256=DMQ6vzRFUYN5BqHdkt3mle7NU0aOO07c5wFBKCS_k3I,1964
3248
3249
  wagtail/search/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3249
3250
  wagtail/search/templates/wagtailsearch/search_results.html,sha256=04u2bj7AJIE_H2jre3v6IiHxUbXuMUBxgfd9O4V8Q4c,710
3250
3251
  wagtail/search/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -4032,9 +4033,9 @@ wagtail/utils/timestamps.py,sha256=wqaIvdtZLUENAYiCP9jN8QPPeud305BlPNJiyTNvxkM,1
4032
4033
  wagtail/utils/urlpatterns.py,sha256=RDhVScxdm-RV4HSMjWElyrbEoTPsXu841_SKMgoFKtY,629
4033
4034
  wagtail/utils/utils.py,sha256=nQhfy-fOiZfUFr67kTX4nF_2VVH7_MDtjTDOzZdpPTE,1407
4034
4035
  wagtail/utils/version.py,sha256=jYCDKIGJD3bZHTpgXMXu14oSBArQnf2WVU979D8V4b0,1552
4035
- wagtail-7.0.1.dist-info/licenses/LICENSE,sha256=0aiL7_RJ2YkOjscmRI7opwmuURrY6h8MR0B24nrdRQU,1512
4036
- wagtail-7.0.1.dist-info/METADATA,sha256=AK2vlQ02fluZPpt4JiKxgVNFBZ39mLKt1S9-MftSefc,12600
4037
- wagtail-7.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
4038
- wagtail-7.0.1.dist-info/entry_points.txt,sha256=R14Z0xKoufNcDaku0EWDKM-K8J4ap0EImO8C-df8HVM,53
4039
- wagtail-7.0.1.dist-info/top_level.txt,sha256=zcKgvuRTi0gSgVzJ1qMoERCwhQ_i0n9bkyxza3oh9as,8
4040
- wagtail-7.0.1.dist-info/RECORD,,
4036
+ wagtail-7.0.3.dist-info/licenses/LICENSE,sha256=0aiL7_RJ2YkOjscmRI7opwmuURrY6h8MR0B24nrdRQU,1512
4037
+ wagtail-7.0.3.dist-info/METADATA,sha256=5L0Ads85Tfn0e3FpbmWOSaL62RTbYQTw3IZt53FLJII,12600
4038
+ wagtail-7.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
4039
+ wagtail-7.0.3.dist-info/entry_points.txt,sha256=R14Z0xKoufNcDaku0EWDKM-K8J4ap0EImO8C-df8HVM,53
4040
+ wagtail-7.0.3.dist-info/top_level.txt,sha256=zcKgvuRTi0gSgVzJ1qMoERCwhQ_i0n9bkyxza3oh9as,8
4041
+ wagtail-7.0.3.dist-info/RECORD,,