wagtail 7.0.2__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.
- wagtail/__init__.py +1 -1
- wagtail/contrib/forms/models.py +2 -0
- wagtail/contrib/forms/tests/test_views.py +23 -0
- {wagtail-7.0.2.dist-info → wagtail-7.0.3.dist-info}/METADATA +1 -1
- {wagtail-7.0.2.dist-info → wagtail-7.0.3.dist-info}/RECORD +9 -9
- {wagtail-7.0.2.dist-info → wagtail-7.0.3.dist-info}/WHEEL +0 -0
- {wagtail-7.0.2.dist-info → wagtail-7.0.3.dist-info}/entry_points.txt +0 -0
- {wagtail-7.0.2.dist-info → wagtail-7.0.3.dist-info}/licenses/LICENSE +0 -0
- {wagtail-7.0.2.dist-info → wagtail-7.0.3.dist-info}/top_level.txt +0 -0
wagtail/__init__.py
CHANGED
|
@@ -6,7 +6,7 @@ from wagtail.utils.version import get_semver_version, get_version
|
|
|
6
6
|
|
|
7
7
|
# major.minor.patch.release.number
|
|
8
8
|
# release must be one of alpha, beta, rc, or final
|
|
9
|
-
VERSION = (7, 0,
|
|
9
|
+
VERSION = (7, 0, 3, "final", 1)
|
|
10
10
|
|
|
11
11
|
__version__ = get_version(VERSION)
|
|
12
12
|
|
wagtail/contrib/forms/models.py
CHANGED
|
@@ -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):
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
wagtail/__init__.py,sha256=
|
|
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
|
|
@@ -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=
|
|
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=
|
|
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
|
|
@@ -4033,9 +4033,9 @@ wagtail/utils/timestamps.py,sha256=wqaIvdtZLUENAYiCP9jN8QPPeud305BlPNJiyTNvxkM,1
|
|
|
4033
4033
|
wagtail/utils/urlpatterns.py,sha256=RDhVScxdm-RV4HSMjWElyrbEoTPsXu841_SKMgoFKtY,629
|
|
4034
4034
|
wagtail/utils/utils.py,sha256=nQhfy-fOiZfUFr67kTX4nF_2VVH7_MDtjTDOzZdpPTE,1407
|
|
4035
4035
|
wagtail/utils/version.py,sha256=jYCDKIGJD3bZHTpgXMXu14oSBArQnf2WVU979D8V4b0,1552
|
|
4036
|
-
wagtail-7.0.
|
|
4037
|
-
wagtail-7.0.
|
|
4038
|
-
wagtail-7.0.
|
|
4039
|
-
wagtail-7.0.
|
|
4040
|
-
wagtail-7.0.
|
|
4041
|
-
wagtail-7.0.
|
|
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,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|