wagtail 7.0rc1__py3-none-any.whl → 7.0.1__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/admin/active_filters.py +3 -3
- wagtail/admin/locale/ca/LC_MESSAGES/django.mo +0 -0
- wagtail/admin/locale/ca/LC_MESSAGES/django.po +53 -1
- wagtail/admin/locale/de/LC_MESSAGES/django.mo +0 -0
- wagtail/admin/locale/de/LC_MESSAGES/django.po +53 -1
- wagtail/admin/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/admin/locale/nl/LC_MESSAGES/django.mo +0 -0
- wagtail/admin/locale/nl/LC_MESSAGES/django.po +21 -2
- wagtail/admin/static/wagtailadmin/css/core.css +1 -1
- wagtail/blocks/base.py +8 -8
- wagtail/blocks/list_block.py +1 -0
- wagtail/contrib/forms/forms.py +54 -24
- wagtail/contrib/forms/locale/af/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/forms/locale/ar/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/ar/LC_MESSAGES/django.po +1 -7
- wagtail/contrib/forms/locale/az_AZ/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/forms/locale/be/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/be/LC_MESSAGES/django.po +1 -7
- wagtail/contrib/forms/locale/bg/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/forms/locale/bn/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/forms/locale/ca/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/ca/LC_MESSAGES/django.po +15 -6
- wagtail/contrib/forms/locale/cs/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/cs/LC_MESSAGES/django.po +1 -8
- wagtail/contrib/forms/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/cy/LC_MESSAGES/django.po +1 -7
- wagtail/contrib/forms/locale/da/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/forms/locale/de/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/de/LC_MESSAGES/django.po +1 -9
- wagtail/contrib/forms/locale/dv/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/forms/locale/el/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/el/LC_MESSAGES/django.po +1 -9
- wagtail/contrib/forms/locale/en/LC_MESSAGES/django.po +11 -4
- wagtail/contrib/forms/locale/es/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/es/LC_MESSAGES/django.po +1 -9
- wagtail/contrib/forms/locale/es_419/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/forms/locale/et/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/et/LC_MESSAGES/django.po +1 -7
- wagtail/contrib/forms/locale/eu/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/forms/locale/fa/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/fa/LC_MESSAGES/django.po +1 -7
- wagtail/contrib/forms/locale/fi/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/fi/LC_MESSAGES/django.po +1 -9
- wagtail/contrib/forms/locale/fr/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/fr/LC_MESSAGES/django.po +7 -6
- wagtail/contrib/forms/locale/gl/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/gl/LC_MESSAGES/django.po +17 -6
- wagtail/contrib/forms/locale/he_IL/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/forms/locale/hr_HR/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/hr_HR/LC_MESSAGES/django.po +1 -9
- wagtail/contrib/forms/locale/ht/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/forms/locale/hu/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/hu/LC_MESSAGES/django.po +1 -9
- wagtail/contrib/forms/locale/hy/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/forms/locale/id_ID/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/id_ID/LC_MESSAGES/django.po +1 -9
- wagtail/contrib/forms/locale/is_IS/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/is_IS/LC_MESSAGES/django.po +1 -9
- wagtail/contrib/forms/locale/it/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/it/LC_MESSAGES/django.po +1 -7
- wagtail/contrib/forms/locale/ja/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/ja/LC_MESSAGES/django.po +1 -9
- wagtail/contrib/forms/locale/ka/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/forms/locale/ko/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/ko/LC_MESSAGES/django.po +1 -9
- wagtail/contrib/forms/locale/lt/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/lt/LC_MESSAGES/django.po +1 -8
- wagtail/contrib/forms/locale/lv/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/forms/locale/mi/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/forms/locale/mn/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/forms/locale/my/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/my/LC_MESSAGES/django.po +1 -7
- wagtail/contrib/forms/locale/nb/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/nb/LC_MESSAGES/django.po +1 -8
- wagtail/contrib/forms/locale/nl/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/nl/LC_MESSAGES/django.po +1 -9
- wagtail/contrib/forms/locale/pl/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/pl/LC_MESSAGES/django.po +1 -7
- wagtail/contrib/forms/locale/pt_BR/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/pt_BR/LC_MESSAGES/django.po +1 -8
- wagtail/contrib/forms/locale/pt_PT/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/pt_PT/LC_MESSAGES/django.po +1 -8
- wagtail/contrib/forms/locale/ro/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/ro/LC_MESSAGES/django.po +1 -7
- wagtail/contrib/forms/locale/ru/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/ru/LC_MESSAGES/django.po +1 -7
- wagtail/contrib/forms/locale/sk_SK/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/sk_SK/LC_MESSAGES/django.po +1 -8
- wagtail/contrib/forms/locale/sl/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/sl/LC_MESSAGES/django.po +1 -7
- wagtail/contrib/forms/locale/sv/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/sv/LC_MESSAGES/django.po +1 -9
- wagtail/contrib/forms/locale/tet/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/tet/LC_MESSAGES/django.po +1 -9
- wagtail/contrib/forms/locale/th/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/th/LC_MESSAGES/django.po +1 -7
- wagtail/contrib/forms/locale/tr/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/tr/LC_MESSAGES/django.po +1 -7
- wagtail/contrib/forms/locale/tr_TR/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/tr_TR/LC_MESSAGES/django.po +1 -7
- wagtail/contrib/forms/locale/ug/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/ug/LC_MESSAGES/django.po +1 -7
- wagtail/contrib/forms/locale/uk/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/uk/LC_MESSAGES/django.po +1 -7
- wagtail/contrib/forms/locale/vi/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/forms/locale/zh/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/forms/locale/zh_Hans/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/zh_Hans/LC_MESSAGES/django.po +1 -7
- wagtail/contrib/forms/locale/zh_Hant/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/zh_Hant/LC_MESSAGES/django.po +1 -7
- wagtail/contrib/forms/tests/test_views.py +189 -9
- wagtail/contrib/forms/views.py +1 -1
- wagtail/contrib/redirects/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/search_promotions/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/settings/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/simple_translation/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/styleguide/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/table_block/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/typed_table_block/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/documents/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/embeds/blocks.py +5 -2
- wagtail/embeds/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/embeds/tests/test_embeds.py +29 -5
- wagtail/images/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/images/models.py +2 -2
- wagtail/images/tests/test_models.py +8 -5
- wagtail/locale/af/LC_MESSAGES/django.po +1 -1
- wagtail/locale/ar/LC_MESSAGES/django.po +1 -1
- wagtail/locale/az_AZ/LC_MESSAGES/django.po +1 -1
- wagtail/locale/be/LC_MESSAGES/django.po +1 -1
- wagtail/locale/bg/LC_MESSAGES/django.po +1 -1
- wagtail/locale/bn/LC_MESSAGES/django.po +1 -1
- wagtail/locale/ca/LC_MESSAGES/django.po +1 -1
- wagtail/locale/cs/LC_MESSAGES/django.po +1 -1
- wagtail/locale/cy/LC_MESSAGES/django.po +1 -1
- wagtail/locale/da/LC_MESSAGES/django.po +1 -1
- wagtail/locale/de/LC_MESSAGES/django.po +1 -1
- wagtail/locale/dv/LC_MESSAGES/django.po +1 -1
- wagtail/locale/el/LC_MESSAGES/django.po +1 -1
- wagtail/locale/en/LC_MESSAGES/django.po +20 -20
- wagtail/locale/es/LC_MESSAGES/django.po +1 -1
- wagtail/locale/es_419/LC_MESSAGES/django.po +1 -1
- wagtail/locale/et/LC_MESSAGES/django.po +1 -1
- wagtail/locale/eu/LC_MESSAGES/django.po +1 -1
- wagtail/locale/fa/LC_MESSAGES/django.po +1 -1
- wagtail/locale/fi/LC_MESSAGES/django.po +1 -1
- wagtail/locale/fr/LC_MESSAGES/django.po +1 -1
- wagtail/locale/gl/LC_MESSAGES/django.po +1 -1
- wagtail/locale/he_IL/LC_MESSAGES/django.po +1 -1
- wagtail/locale/hr_HR/LC_MESSAGES/django.po +1 -1
- wagtail/locale/hu/LC_MESSAGES/django.po +1 -1
- wagtail/locale/id_ID/LC_MESSAGES/django.po +1 -1
- wagtail/locale/is_IS/LC_MESSAGES/django.po +1 -1
- wagtail/locale/it/LC_MESSAGES/django.po +1 -1
- wagtail/locale/ja/LC_MESSAGES/django.po +1 -1
- wagtail/locale/ka/LC_MESSAGES/django.po +1 -1
- wagtail/locale/ko/LC_MESSAGES/django.po +1 -1
- wagtail/locale/lt/LC_MESSAGES/django.po +1 -1
- wagtail/locale/lv/LC_MESSAGES/django.po +1 -1
- wagtail/locale/mi/LC_MESSAGES/django.po +1 -1
- wagtail/locale/mn/LC_MESSAGES/django.po +1 -1
- wagtail/locale/my/LC_MESSAGES/django.po +1 -1
- wagtail/locale/nb/LC_MESSAGES/django.po +1 -1
- wagtail/locale/nl/LC_MESSAGES/django.po +1 -1
- wagtail/locale/pl/LC_MESSAGES/django.po +1 -1
- wagtail/locale/pt_BR/LC_MESSAGES/django.po +1 -1
- wagtail/locale/pt_PT/LC_MESSAGES/django.po +1 -1
- wagtail/locale/ro/LC_MESSAGES/django.po +1 -1
- wagtail/locale/ru/LC_MESSAGES/django.po +1 -1
- wagtail/locale/sk_SK/LC_MESSAGES/django.po +1 -1
- wagtail/locale/sl/LC_MESSAGES/django.po +1 -1
- wagtail/locale/sv/LC_MESSAGES/django.po +1 -1
- wagtail/locale/tet/LC_MESSAGES/django.po +1 -1
- wagtail/locale/th/LC_MESSAGES/django.po +1 -1
- wagtail/locale/tr/LC_MESSAGES/django.po +1 -1
- wagtail/locale/tr_TR/LC_MESSAGES/django.po +1 -1
- wagtail/locale/ug/LC_MESSAGES/django.po +1 -1
- wagtail/locale/uk/LC_MESSAGES/django.po +1 -1
- wagtail/locale/vi/LC_MESSAGES/django.po +1 -1
- wagtail/locale/zh/LC_MESSAGES/django.po +1 -1
- wagtail/locale/zh_Hans/LC_MESSAGES/django.po +1 -1
- wagtail/locale/zh_Hant/LC_MESSAGES/django.po +1 -1
- wagtail/locales/locale/ca/LC_MESSAGES/django.mo +0 -0
- wagtail/locales/locale/ca/LC_MESSAGES/django.po +13 -3
- wagtail/locales/locale/de/LC_MESSAGES/django.mo +0 -0
- wagtail/locales/locale/de/LC_MESSAGES/django.po +13 -2
- wagtail/locales/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/models/pages.py +8 -4
- wagtail/project_template/requirements.txt +1 -1
- wagtail/search/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/sites/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/snippets/locale/ca/LC_MESSAGES/django.mo +0 -0
- wagtail/snippets/locale/ca/LC_MESSAGES/django.po +7 -1
- wagtail/snippets/locale/de/LC_MESSAGES/django.mo +0 -0
- wagtail/snippets/locale/de/LC_MESSAGES/django.po +9 -3
- wagtail/snippets/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/snippets/locale/nl/LC_MESSAGES/django.mo +0 -0
- wagtail/snippets/locale/nl/LC_MESSAGES/django.po +9 -2
- wagtail/test/settings.py +6 -2
- wagtail/tests/test_streamfield.py +48 -0
- wagtail/users/locale/en/LC_MESSAGES/django.po +1 -1
- {wagtail-7.0rc1.dist-info → wagtail-7.0.1.dist-info}/METADATA +2 -2
- {wagtail-7.0rc1.dist-info → wagtail-7.0.1.dist-info}/RECORD +208 -208
- {wagtail-7.0rc1.dist-info → wagtail-7.0.1.dist-info}/WHEEL +1 -1
- {wagtail-7.0rc1.dist-info → wagtail-7.0.1.dist-info}/entry_points.txt +0 -0
- {wagtail-7.0rc1.dist-info → wagtail-7.0.1.dist-info}/licenses/LICENSE +0 -0
- {wagtail-7.0rc1.dist-info → wagtail-7.0.1.dist-info}/top_level.txt +0 -0
|
@@ -14,7 +14,7 @@ msgid ""
|
|
|
14
14
|
msgstr ""
|
|
15
15
|
"Project-Id-Version: Wagtail\n"
|
|
16
16
|
"Report-Msgid-Bugs-To: \n"
|
|
17
|
-
"POT-Creation-Date: 2025-04-
|
|
17
|
+
"POT-Creation-Date: 2025-04-25 23:08+0100\n"
|
|
18
18
|
"PO-Revision-Date: 2014-09-11 15:42+0000\n"
|
|
19
19
|
"Last-Translator: José Luis <alagunajs@gmail.com>, 2015,2017\n"
|
|
20
20
|
"Language-Team: Turkish (Turkey) (http://app.transifex.com/torchbox/wagtail/"
|
|
@@ -34,12 +34,6 @@ msgstr "Başlangıç tarihi"
|
|
|
34
34
|
msgid "Date to"
|
|
35
35
|
msgstr "Bitiş tarihi"
|
|
36
36
|
|
|
37
|
-
#, python-format
|
|
38
|
-
msgid ""
|
|
39
|
-
"There is another field with the label %(label_name)s, please change one of "
|
|
40
|
-
"them."
|
|
41
|
-
msgstr "%(label_name)s adında başka bir alan var, lütfen birini değiştirin."
|
|
42
|
-
|
|
43
37
|
msgid "Single line text"
|
|
44
38
|
msgstr "Tek satır metin"
|
|
45
39
|
|
|
Binary file
|
|
@@ -8,7 +8,7 @@ msgid ""
|
|
|
8
8
|
msgstr ""
|
|
9
9
|
"Project-Id-Version: Wagtail\n"
|
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
|
11
|
-
"POT-Creation-Date: 2025-04-
|
|
11
|
+
"POT-Creation-Date: 2025-04-25 23:08+0100\n"
|
|
12
12
|
"PO-Revision-Date: 2014-09-11 15:42+0000\n"
|
|
13
13
|
"Last-Translator: Abduqadir Abliz <sahranbay@gmail.com>, 2024\n"
|
|
14
14
|
"Language-Team: Uyghur (http://app.transifex.com/torchbox/wagtail/language/"
|
|
@@ -28,12 +28,6 @@ msgstr "مۇددەت باشلىنىشى"
|
|
|
28
28
|
msgid "Date to"
|
|
29
29
|
msgstr "مۇددەت پۈتۈشى"
|
|
30
30
|
|
|
31
|
-
#, python-format
|
|
32
|
-
msgid ""
|
|
33
|
-
"There is another field with the label %(label_name)s, please change one of "
|
|
34
|
-
"them."
|
|
35
|
-
msgstr "يەنە بىر %(label_name)s بۆلەك بار، ئۇلارنىڭ بىرىنى ئۆزگەرتىڭ."
|
|
36
|
-
|
|
37
31
|
msgid "Single line text"
|
|
38
32
|
msgstr "يەككە قۇرلۇق تېكىست"
|
|
39
33
|
|
|
Binary file
|
|
@@ -11,7 +11,7 @@ msgid ""
|
|
|
11
11
|
msgstr ""
|
|
12
12
|
"Project-Id-Version: Wagtail\n"
|
|
13
13
|
"Report-Msgid-Bugs-To: \n"
|
|
14
|
-
"POT-Creation-Date: 2025-04-
|
|
14
|
+
"POT-Creation-Date: 2025-04-25 23:08+0100\n"
|
|
15
15
|
"PO-Revision-Date: 2014-09-11 15:42+0000\n"
|
|
16
16
|
"Last-Translator: d55ee35323c0c760f088259cd23b1b6d_9e8a7d1 "
|
|
17
17
|
"<5459f3ae99ecdd5ed0be0220acd46004_1019581>, 2021\n"
|
|
@@ -35,12 +35,6 @@ msgstr "Дата початку"
|
|
|
35
35
|
msgid "Date to"
|
|
36
36
|
msgstr "Дата кінця"
|
|
37
37
|
|
|
38
|
-
#, python-format
|
|
39
|
-
msgid ""
|
|
40
|
-
"There is another field with the label %(label_name)s, please change one of "
|
|
41
|
-
"them."
|
|
42
|
-
msgstr "Є інше поле з міткою %(label_name)s, будь ласка, змініть одну з них."
|
|
43
|
-
|
|
44
38
|
msgid "Single line text"
|
|
45
39
|
msgstr "Однорядковий текст"
|
|
46
40
|
|
|
@@ -9,7 +9,7 @@ msgid ""
|
|
|
9
9
|
msgstr ""
|
|
10
10
|
"Project-Id-Version: Wagtail\n"
|
|
11
11
|
"Report-Msgid-Bugs-To: \n"
|
|
12
|
-
"POT-Creation-Date: 2025-04-
|
|
12
|
+
"POT-Creation-Date: 2025-04-25 23:08+0100\n"
|
|
13
13
|
"PO-Revision-Date: 2014-09-11 15:42+0000\n"
|
|
14
14
|
"Last-Translator: Vu Pham, 2021\n"
|
|
15
15
|
"Language-Team: Vietnamese (http://app.transifex.com/torchbox/wagtail/"
|
|
@@ -7,7 +7,7 @@ msgid ""
|
|
|
7
7
|
msgstr ""
|
|
8
8
|
"Project-Id-Version: Wagtail\n"
|
|
9
9
|
"Report-Msgid-Bugs-To: \n"
|
|
10
|
-
"POT-Creation-Date: 2025-04-
|
|
10
|
+
"POT-Creation-Date: 2025-04-25 23:08+0100\n"
|
|
11
11
|
"PO-Revision-Date: 2014-09-11 15:42+0000\n"
|
|
12
12
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
13
13
|
"Language-Team: Chinese (http://app.transifex.com/torchbox/wagtail/language/"
|
|
Binary file
|
|
@@ -22,7 +22,7 @@ msgid ""
|
|
|
22
22
|
msgstr ""
|
|
23
23
|
"Project-Id-Version: Wagtail\n"
|
|
24
24
|
"Report-Msgid-Bugs-To: \n"
|
|
25
|
-
"POT-Creation-Date: 2025-04-
|
|
25
|
+
"POT-Creation-Date: 2025-04-25 23:08+0100\n"
|
|
26
26
|
"PO-Revision-Date: 2014-09-11 15:42+0000\n"
|
|
27
27
|
"Last-Translator: 祝沙军 <zhushajun@gmail.com>, 2017\n"
|
|
28
28
|
"Language-Team: Chinese (China) (http://app.transifex.com/torchbox/wagtail/"
|
|
@@ -42,12 +42,6 @@ msgstr "起始日起"
|
|
|
42
42
|
msgid "Date to"
|
|
43
43
|
msgstr "结束日期"
|
|
44
44
|
|
|
45
|
-
#, python-format
|
|
46
|
-
msgid ""
|
|
47
|
-
"There is another field with the label %(label_name)s, please change one of "
|
|
48
|
-
"them."
|
|
49
|
-
msgstr "%(label_name)s 标签被其它字段使用,请更换一个标签。"
|
|
50
|
-
|
|
51
45
|
msgid "Single line text"
|
|
52
46
|
msgstr "单行文本"
|
|
53
47
|
|
|
Binary file
|
|
@@ -11,7 +11,7 @@ msgid ""
|
|
|
11
11
|
msgstr ""
|
|
12
12
|
"Project-Id-Version: Wagtail\n"
|
|
13
13
|
"Report-Msgid-Bugs-To: \n"
|
|
14
|
-
"POT-Creation-Date: 2025-04-
|
|
14
|
+
"POT-Creation-Date: 2025-04-25 23:08+0100\n"
|
|
15
15
|
"PO-Revision-Date: 2014-09-11 15:42+0000\n"
|
|
16
16
|
"Last-Translator: Ocin Leung, 2020\n"
|
|
17
17
|
"Language-Team: Chinese Traditional (http://app.transifex.com/torchbox/"
|
|
@@ -31,12 +31,6 @@ msgstr "起始日期"
|
|
|
31
31
|
msgid "Date to"
|
|
32
32
|
msgstr "結束日期"
|
|
33
33
|
|
|
34
|
-
#, python-format
|
|
35
|
-
msgid ""
|
|
36
|
-
"There is another field with the label %(label_name)s, please change one of "
|
|
37
|
-
"them."
|
|
38
|
-
msgstr "%(label_name)s 標簽被其它欄位使用,請更換一個標簽。"
|
|
39
|
-
|
|
40
34
|
msgid "Single line text"
|
|
41
35
|
msgstr "單行文本"
|
|
42
36
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import datetime
|
|
2
|
+
import html
|
|
2
3
|
from io import BytesIO
|
|
3
4
|
|
|
4
5
|
from django.conf import settings
|
|
@@ -552,15 +553,39 @@ class TestFormsSubmissionsList(WagtailTestUtils, TestCase):
|
|
|
552
553
|
self.assertEqual(len(response.context["data_rows"]), 1)
|
|
553
554
|
|
|
554
555
|
def test_list_submissions_filtering_range(self):
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
)
|
|
556
|
+
url = reverse("wagtailforms:list_submissions", args=(self.form_page.id,))
|
|
557
|
+
params = {"date_from": "12/31/2013", "date_to": "01/02/2014"}
|
|
558
|
+
response = self.client.get(url, params)
|
|
559
559
|
|
|
560
560
|
# Check response
|
|
561
561
|
self.assertEqual(response.status_code, 200)
|
|
562
562
|
self.assertTemplateUsed(response, "wagtailforms/submissions_index.html")
|
|
563
563
|
self.assertEqual(len(response.context["data_rows"]), 1)
|
|
564
|
+
soup = self.get_soup(response.content)
|
|
565
|
+
next_input = soup.select_one('input[name="next"]')
|
|
566
|
+
self.assertIsNotNone(next_input)
|
|
567
|
+
self.assertEqual(next_input["value"], f"{url}?{urlencode(params)}")
|
|
568
|
+
|
|
569
|
+
def test_list_submissions_filtering_results(self):
|
|
570
|
+
index_url = reverse("wagtailforms:list_submissions", args=(self.form_page.id,))
|
|
571
|
+
results_url = reverse(
|
|
572
|
+
"wagtailforms:list_submissions_results",
|
|
573
|
+
args=(self.form_page.id,),
|
|
574
|
+
)
|
|
575
|
+
params = {"date_from": "12/31/2013", "date_to": "01/02/2014"}
|
|
576
|
+
response = self.client.get(results_url, params)
|
|
577
|
+
|
|
578
|
+
# Check response
|
|
579
|
+
self.assertEqual(response.status_code, 200)
|
|
580
|
+
self.assertTemplateNotUsed(response, "wagtailforms/submissions_index.html")
|
|
581
|
+
self.assertTemplateUsed(response, "wagtailforms/list_submissions.html")
|
|
582
|
+
self.assertEqual(len(response.context["data_rows"]), 1)
|
|
583
|
+
soup = self.get_soup(response.content)
|
|
584
|
+
next_input = soup.select_one('input[name="next"]')
|
|
585
|
+
self.assertIsNotNone(next_input)
|
|
586
|
+
# The next URL should point to the index page (instead of results page)
|
|
587
|
+
# with the same query params to preserve the filter
|
|
588
|
+
self.assertEqual(next_input["value"], f"{index_url}?{urlencode(params)}")
|
|
564
589
|
|
|
565
590
|
def test_list_submissions_pagination(self):
|
|
566
591
|
self.make_list_submissions()
|
|
@@ -1851,9 +1876,13 @@ class TestDuplicateFormFieldLabels(WagtailTestUtils, TestCase):
|
|
|
1851
1876
|
|
|
1852
1877
|
self.assertEqual(response.status_code, 200)
|
|
1853
1878
|
|
|
1879
|
+
expected_validation_error_msg = html.escape(
|
|
1880
|
+
"Field name 'foo' conflicts with another field. Please change the label."
|
|
1881
|
+
)
|
|
1882
|
+
|
|
1854
1883
|
self.assertContains(
|
|
1855
1884
|
response,
|
|
1856
|
-
|
|
1885
|
+
expected_validation_error_msg,
|
|
1857
1886
|
)
|
|
1858
1887
|
|
|
1859
1888
|
def test_adding_duplicate_form_labels_as_cleaned_name(self):
|
|
@@ -1889,9 +1918,14 @@ class TestDuplicateFormFieldLabels(WagtailTestUtils, TestCase):
|
|
|
1889
1918
|
|
|
1890
1919
|
self.assertEqual(response.status_code, 200)
|
|
1891
1920
|
|
|
1921
|
+
expected_validation_error_msg = html.escape(
|
|
1922
|
+
"Field name 'low_earth_orbit' conflicts with another field. "
|
|
1923
|
+
"Please change the label."
|
|
1924
|
+
)
|
|
1925
|
+
|
|
1892
1926
|
self.assertContains(
|
|
1893
1927
|
response,
|
|
1894
|
-
|
|
1928
|
+
expected_validation_error_msg,
|
|
1895
1929
|
)
|
|
1896
1930
|
|
|
1897
1931
|
def test_adding_duplicate_form_labels_using_override_clean_name(self):
|
|
@@ -1928,9 +1962,14 @@ class TestDuplicateFormFieldLabels(WagtailTestUtils, TestCase):
|
|
|
1928
1962
|
|
|
1929
1963
|
self.assertEqual(response.status_code, 200)
|
|
1930
1964
|
|
|
1965
|
+
expected_validation_error_msg = html.escape(
|
|
1966
|
+
"Field name 'test duplicate' conflicts with another field. "
|
|
1967
|
+
"Please change the label."
|
|
1968
|
+
)
|
|
1969
|
+
|
|
1931
1970
|
self.assertContains(
|
|
1932
1971
|
response,
|
|
1933
|
-
|
|
1972
|
+
expected_validation_error_msg,
|
|
1934
1973
|
)
|
|
1935
1974
|
|
|
1936
1975
|
def test_rename_existing_field_and_add_new_field_with_clashing_clean_name(
|
|
@@ -1968,9 +2007,15 @@ class TestDuplicateFormFieldLabels(WagtailTestUtils, TestCase):
|
|
|
1968
2007
|
)
|
|
1969
2008
|
|
|
1970
2009
|
self.assertEqual(response.status_code, 200)
|
|
2010
|
+
|
|
2011
|
+
expected_validation_error_msg = html.escape(
|
|
2012
|
+
"Field name 'test_field' conflicts with another field. "
|
|
2013
|
+
"Please change the label."
|
|
2014
|
+
)
|
|
2015
|
+
|
|
1971
2016
|
self.assertContains(
|
|
1972
2017
|
response,
|
|
1973
|
-
|
|
2018
|
+
expected_validation_error_msg,
|
|
1974
2019
|
)
|
|
1975
2020
|
|
|
1976
2021
|
def test_adding_duplicate_form_labels_with_custom_related_name(self):
|
|
@@ -2014,10 +2059,145 @@ class TestDuplicateFormFieldLabels(WagtailTestUtils, TestCase):
|
|
|
2014
2059
|
|
|
2015
2060
|
self.assertEqual(response.status_code, 200)
|
|
2016
2061
|
|
|
2062
|
+
expected_validation_error_msg = html.escape(
|
|
2063
|
+
"Field name 'chocolate' conflicts with another field. "
|
|
2064
|
+
"Please change the label."
|
|
2065
|
+
)
|
|
2066
|
+
|
|
2017
2067
|
self.assertContains(
|
|
2018
2068
|
response,
|
|
2019
|
-
|
|
2069
|
+
expected_validation_error_msg,
|
|
2070
|
+
)
|
|
2071
|
+
|
|
2072
|
+
def test_validation_errors_are_added_to_all_duplicate_fields(self):
|
|
2073
|
+
"""
|
|
2074
|
+
Ensure all forms with duplicate labels have the correct validation error added.
|
|
2075
|
+
"""
|
|
2076
|
+
|
|
2077
|
+
form_page = FormPage(
|
|
2078
|
+
title="Form page!",
|
|
2079
|
+
form_fields=[FormField(label="Test field", field_type="singleline")],
|
|
2020
2080
|
)
|
|
2081
|
+
self.root_page.add_child(instance=form_page)
|
|
2082
|
+
|
|
2083
|
+
post_data = {
|
|
2084
|
+
"title": "Form page!",
|
|
2085
|
+
"slug": "form-page",
|
|
2086
|
+
"form_fields-TOTAL_FORMS": "5",
|
|
2087
|
+
"form_fields-INITIAL_FORMS": "1",
|
|
2088
|
+
"form_fields-MIN_NUM_FORMS": "0",
|
|
2089
|
+
"form_fields-MAX_NUM_FORMS": "1000",
|
|
2090
|
+
# Duplicate field labels
|
|
2091
|
+
"form_fields-0-id": form_page.form_fields.first().pk,
|
|
2092
|
+
"form_fields-0-label": "Test field",
|
|
2093
|
+
"form_fields-0-field_type": "singleline",
|
|
2094
|
+
"form_fields-1-id": "",
|
|
2095
|
+
"form_fields-1-label": "Test field",
|
|
2096
|
+
"form_fields-1-field_type": "singleline",
|
|
2097
|
+
"form_fields-2-id": "",
|
|
2098
|
+
"form_fields-2-label": "Test field",
|
|
2099
|
+
"form_fields-2-field_type": "singleline",
|
|
2100
|
+
"form_fields-3-id": "",
|
|
2101
|
+
"form_fields-3-label": "duplicate 2",
|
|
2102
|
+
"form_fields-3-field_type": "singleline",
|
|
2103
|
+
"form_fields-4-id": "",
|
|
2104
|
+
"form_fields-4-label": "duplicate 2",
|
|
2105
|
+
"form_fields-4-field_type": "singleline",
|
|
2106
|
+
}
|
|
2107
|
+
|
|
2108
|
+
response = self.client.post(
|
|
2109
|
+
reverse("wagtailadmin_pages:edit", args=[form_page.pk]), post_data
|
|
2110
|
+
)
|
|
2111
|
+
|
|
2112
|
+
self.assertEqual(response.status_code, 200)
|
|
2113
|
+
|
|
2114
|
+
form = response.context["form"]
|
|
2115
|
+
formset = form.formsets["form_fields"]
|
|
2116
|
+
|
|
2117
|
+
# Expected validation error messages
|
|
2118
|
+
expected_error_text_field_0 = (
|
|
2119
|
+
"The name 'test_field' is already assigned to this field and cannot be "
|
|
2120
|
+
"changed. Please enter a different label for the conflicting field."
|
|
2121
|
+
)
|
|
2122
|
+
expected_error_text_fields_1_2 = (
|
|
2123
|
+
"Field name 'test_field' conflicts with another field. Please "
|
|
2124
|
+
"change the label."
|
|
2125
|
+
)
|
|
2126
|
+
expected_error_text_fields_3_4 = (
|
|
2127
|
+
"Field name 'duplicate_2' conflicts with another field. Please "
|
|
2128
|
+
"change the label."
|
|
2129
|
+
)
|
|
2130
|
+
|
|
2131
|
+
# Check validation errors for form 0
|
|
2132
|
+
self.assertIn("label", formset.forms[0].errors)
|
|
2133
|
+
self.assertEqual(
|
|
2134
|
+
formset.forms[0].errors["label"][0],
|
|
2135
|
+
expected_error_text_field_0,
|
|
2136
|
+
)
|
|
2137
|
+
|
|
2138
|
+
# Check validation errors for forms 1 and 2
|
|
2139
|
+
for i in [1, 2]:
|
|
2140
|
+
with self.subTest(
|
|
2141
|
+
form_index=i,
|
|
2142
|
+
):
|
|
2143
|
+
self.assertIn("label", formset.forms[i].errors)
|
|
2144
|
+
self.assertEqual(
|
|
2145
|
+
formset.forms[i].errors["label"][0],
|
|
2146
|
+
expected_error_text_fields_1_2,
|
|
2147
|
+
)
|
|
2148
|
+
|
|
2149
|
+
# Check validation errors for forms 3 and 4
|
|
2150
|
+
for i in [3, 4]:
|
|
2151
|
+
with self.subTest(
|
|
2152
|
+
form_index=i,
|
|
2153
|
+
):
|
|
2154
|
+
self.assertIn("label", formset.forms[i].errors)
|
|
2155
|
+
self.assertEqual(
|
|
2156
|
+
formset.forms[i].errors["label"][0],
|
|
2157
|
+
expected_error_text_fields_3_4,
|
|
2158
|
+
)
|
|
2159
|
+
|
|
2160
|
+
def test_deletion_of_duplicate_formset_form_field_allows_page_publish(self):
|
|
2161
|
+
"""
|
|
2162
|
+
Test that deleting a duplicate formset form field allows the page to be
|
|
2163
|
+
published.
|
|
2164
|
+
"""
|
|
2165
|
+
form_page = FormPage(
|
|
2166
|
+
title="Form page!",
|
|
2167
|
+
form_fields=[FormField(label="Test field", field_type="singleline")],
|
|
2168
|
+
live=False,
|
|
2169
|
+
)
|
|
2170
|
+
self.root_page.add_child(instance=form_page)
|
|
2171
|
+
self.assertFalse(form_page.live)
|
|
2172
|
+
|
|
2173
|
+
post_data = {
|
|
2174
|
+
"title": "Form page!",
|
|
2175
|
+
"slug": "form-page",
|
|
2176
|
+
"action-publish": "action-publish",
|
|
2177
|
+
"form_fields-TOTAL_FORMS": "2",
|
|
2178
|
+
"form_fields-INITIAL_FORMS": "1",
|
|
2179
|
+
"form_fields-MIN_NUM_FORMS": "0",
|
|
2180
|
+
"form_fields-MAX_NUM_FORMS": "1000",
|
|
2181
|
+
"form_fields-0-id": form_page.form_fields.first().pk,
|
|
2182
|
+
"form_fields-0-label": "Test field",
|
|
2183
|
+
"form_fields-0-field_type": "singleline",
|
|
2184
|
+
# Add a duplicate field but mark it for deletion
|
|
2185
|
+
"form_fields-1-id": "",
|
|
2186
|
+
"form_fields-1-label": "Test field",
|
|
2187
|
+
"form_fields-1-field_type": "singleline",
|
|
2188
|
+
"form_fields-1-DELETE": "on",
|
|
2189
|
+
}
|
|
2190
|
+
|
|
2191
|
+
response = self.client.post(
|
|
2192
|
+
reverse("wagtailadmin_pages:edit", args=[form_page.pk]), post_data
|
|
2193
|
+
)
|
|
2194
|
+
|
|
2195
|
+
# Response should redirect to parent page list view
|
|
2196
|
+
self.assertEqual(response.status_code, 302)
|
|
2197
|
+
|
|
2198
|
+
form_page.refresh_from_db()
|
|
2199
|
+
|
|
2200
|
+
self.assertTrue(form_page.live)
|
|
2021
2201
|
|
|
2022
2202
|
|
|
2023
2203
|
class TestPreview(WagtailTestUtils, TestCase):
|
wagtail/contrib/forms/views.py
CHANGED
|
@@ -8,7 +8,7 @@ msgid ""
|
|
|
8
8
|
msgstr ""
|
|
9
9
|
"Project-Id-Version: PACKAGE VERSION\n"
|
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
|
11
|
-
"POT-Creation-Date: 2025-04-
|
|
11
|
+
"POT-Creation-Date: 2025-04-25 23:08+0100\n"
|
|
12
12
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
13
13
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
14
14
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
@@ -8,7 +8,7 @@ msgid ""
|
|
|
8
8
|
msgstr ""
|
|
9
9
|
"Project-Id-Version: PACKAGE VERSION\n"
|
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
|
11
|
-
"POT-Creation-Date: 2025-04-
|
|
11
|
+
"POT-Creation-Date: 2025-04-25 23:08+0100\n"
|
|
12
12
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
13
13
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
14
14
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
@@ -8,7 +8,7 @@ msgid ""
|
|
|
8
8
|
msgstr ""
|
|
9
9
|
"Project-Id-Version: PACKAGE VERSION\n"
|
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
|
11
|
-
"POT-Creation-Date: 2025-04-
|
|
11
|
+
"POT-Creation-Date: 2025-04-25 23:09+0100\n"
|
|
12
12
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
13
13
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
14
14
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
@@ -8,7 +8,7 @@ msgid ""
|
|
|
8
8
|
msgstr ""
|
|
9
9
|
"Project-Id-Version: PACKAGE VERSION\n"
|
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
|
11
|
-
"POT-Creation-Date: 2025-04-
|
|
11
|
+
"POT-Creation-Date: 2025-04-25 23:09+0100\n"
|
|
12
12
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
13
13
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
14
14
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
@@ -8,7 +8,7 @@ msgid ""
|
|
|
8
8
|
msgstr ""
|
|
9
9
|
"Project-Id-Version: PACKAGE VERSION\n"
|
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
|
11
|
-
"POT-Creation-Date: 2025-04-
|
|
11
|
+
"POT-Creation-Date: 2025-04-25 23:09+0100\n"
|
|
12
12
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
13
13
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
14
14
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
@@ -8,7 +8,7 @@ msgid ""
|
|
|
8
8
|
msgstr ""
|
|
9
9
|
"Project-Id-Version: PACKAGE VERSION\n"
|
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
|
11
|
-
"POT-Creation-Date: 2025-04-
|
|
11
|
+
"POT-Creation-Date: 2025-04-25 23:09+0100\n"
|
|
12
12
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
13
13
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
14
14
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
@@ -8,7 +8,7 @@ msgid ""
|
|
|
8
8
|
msgstr ""
|
|
9
9
|
"Project-Id-Version: PACKAGE VERSION\n"
|
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
|
11
|
-
"POT-Creation-Date: 2025-04-
|
|
11
|
+
"POT-Creation-Date: 2025-04-25 23:09+0100\n"
|
|
12
12
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
13
13
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
14
14
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
@@ -8,7 +8,7 @@ msgid ""
|
|
|
8
8
|
msgstr ""
|
|
9
9
|
"Project-Id-Version: PACKAGE VERSION\n"
|
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
|
11
|
-
"POT-Creation-Date: 2025-04-
|
|
11
|
+
"POT-Creation-Date: 2025-04-25 23:09+0100\n"
|
|
12
12
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
13
13
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
14
14
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
wagtail/embeds/blocks.py
CHANGED
|
@@ -87,8 +87,11 @@ class EmbedBlock(blocks.URLBlock):
|
|
|
87
87
|
|
|
88
88
|
def normalize(self, value):
|
|
89
89
|
if isinstance(value, EmbedValue):
|
|
90
|
-
return value
|
|
91
|
-
|
|
90
|
+
return value if value.url else None
|
|
91
|
+
elif value:
|
|
92
|
+
return EmbedValue(value)
|
|
93
|
+
else:
|
|
94
|
+
return None
|
|
92
95
|
|
|
93
96
|
class Meta:
|
|
94
97
|
icon = "media"
|
|
@@ -8,7 +8,7 @@ msgid ""
|
|
|
8
8
|
msgstr ""
|
|
9
9
|
"Project-Id-Version: PACKAGE VERSION\n"
|
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
|
11
|
-
"POT-Creation-Date: 2025-04-
|
|
11
|
+
"POT-Creation-Date: 2025-04-25 23:09+0100\n"
|
|
12
12
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
13
13
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
14
14
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
@@ -952,15 +952,23 @@ class TestEmbedBlock(TestCase):
|
|
|
952
952
|
block = EmbedBlock()
|
|
953
953
|
|
|
954
954
|
cleaned_value = block.clean(
|
|
955
|
-
EmbedValue("https://www.youtube.com/watch?v=_U79Wc965vw")
|
|
955
|
+
block.normalize(EmbedValue("https://www.youtube.com/watch?v=_U79Wc965vw"))
|
|
956
956
|
)
|
|
957
957
|
self.assertIsInstance(cleaned_value, EmbedValue)
|
|
958
958
|
self.assertEqual(
|
|
959
959
|
cleaned_value.url, "https://www.youtube.com/watch?v=_U79Wc965vw"
|
|
960
960
|
)
|
|
961
961
|
|
|
962
|
+
@patch("wagtail.embeds.embeds.get_embed")
|
|
963
|
+
def test_clean_required_empty(self, get_embed):
|
|
964
|
+
get_embed.return_value = Embed(html="<h1>Hello world!</h1>")
|
|
965
|
+
|
|
966
|
+
block = EmbedBlock()
|
|
967
|
+
|
|
962
968
|
with self.assertRaisesMessage(ValidationError, ""):
|
|
963
|
-
block.clean(None)
|
|
969
|
+
block.clean(block.normalize(None))
|
|
970
|
+
|
|
971
|
+
get_embed.assert_not_called()
|
|
964
972
|
|
|
965
973
|
@patch("wagtail.embeds.embeds.get_embed")
|
|
966
974
|
def test_clean_non_required(self, get_embed):
|
|
@@ -976,9 +984,17 @@ class TestEmbedBlock(TestCase):
|
|
|
976
984
|
cleaned_value.url, "https://www.youtube.com/watch?v=_U79Wc965vw"
|
|
977
985
|
)
|
|
978
986
|
|
|
979
|
-
|
|
987
|
+
@patch("wagtail.embeds.embeds.get_embed")
|
|
988
|
+
def test_clean_non_required_empty(self, get_embed):
|
|
989
|
+
get_embed.return_value = Embed(html="<h1>Hello world!</h1>")
|
|
990
|
+
|
|
991
|
+
block = EmbedBlock(required=False)
|
|
992
|
+
|
|
993
|
+
cleaned_value = block.clean(block.normalize(None))
|
|
980
994
|
self.assertIsNone(cleaned_value)
|
|
981
995
|
|
|
996
|
+
get_embed.assert_not_called()
|
|
997
|
+
|
|
982
998
|
@patch("wagtail.embeds.embeds.get_embed")
|
|
983
999
|
def test_clean_invalid_url(self, get_embed):
|
|
984
1000
|
get_embed.side_effect = EmbedNotFoundException
|
|
@@ -986,9 +1002,17 @@ class TestEmbedBlock(TestCase):
|
|
|
986
1002
|
non_required_block = EmbedBlock(required=False)
|
|
987
1003
|
|
|
988
1004
|
with self.assertRaises(ValidationError):
|
|
989
|
-
non_required_block.clean(
|
|
1005
|
+
non_required_block.clean(
|
|
1006
|
+
non_required_block.normalize(
|
|
1007
|
+
EmbedValue("http://no-oembed-here.com/something")
|
|
1008
|
+
)
|
|
1009
|
+
)
|
|
990
1010
|
|
|
991
1011
|
required_block = EmbedBlock()
|
|
992
1012
|
|
|
993
1013
|
with self.assertRaises(ValidationError):
|
|
994
|
-
required_block.clean(
|
|
1014
|
+
required_block.clean(
|
|
1015
|
+
non_required_block.normalize(
|
|
1016
|
+
EmbedValue("http://no-oembed-here.com/something")
|
|
1017
|
+
)
|
|
1018
|
+
)
|
|
@@ -8,7 +8,7 @@ msgid ""
|
|
|
8
8
|
msgstr ""
|
|
9
9
|
"Project-Id-Version: PACKAGE VERSION\n"
|
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
|
11
|
-
"POT-Creation-Date: 2025-04-
|
|
11
|
+
"POT-Creation-Date: 2025-04-25 23:09+0100\n"
|
|
12
12
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
13
13
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
14
14
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
wagtail/images/models.py
CHANGED
|
@@ -1405,8 +1405,8 @@ class AbstractRendition(ImageFileMixin, models.Model):
|
|
|
1405
1405
|
"on the 'image', 'filter_spec', and 'focal_point_key' fields."
|
|
1406
1406
|
% cls._meta.label,
|
|
1407
1407
|
hint=(
|
|
1408
|
-
"Add models.UniqueConstraint(fields=
|
|
1409
|
-
'"image", "filter_spec", "focal_point_key"
|
|
1408
|
+
"Add models.UniqueConstraint(fields=("
|
|
1409
|
+
'"image", "filter_spec", "focal_point_key"), '
|
|
1410
1410
|
'name="unique_rendition") to %s.Meta.constraints.'
|
|
1411
1411
|
% (cls.__name__,)
|
|
1412
1412
|
),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import hashlib
|
|
1
2
|
import unittest
|
|
2
3
|
|
|
3
4
|
from django.conf import settings
|
|
@@ -131,9 +132,11 @@ class TestImage(TestCase):
|
|
|
131
132
|
self.image.get_file_size()
|
|
132
133
|
|
|
133
134
|
def test_file_hash(self):
|
|
134
|
-
self.
|
|
135
|
-
|
|
136
|
-
)
|
|
135
|
+
with self.image.file.open() as f:
|
|
136
|
+
loaded_hash = hashlib.sha1(f.read()).hexdigest()
|
|
137
|
+
# Ensure get_file_hash() (which does the hash by chunks) returns the
|
|
138
|
+
# same hash as the one calculated by loading the file into memory.
|
|
139
|
+
self.assertEqual(self.image.get_file_hash(), loaded_hash)
|
|
137
140
|
|
|
138
141
|
def test_get_suggested_focal_point_svg(self):
|
|
139
142
|
"""
|
|
@@ -548,8 +551,8 @@ class TestRenditions(TestCase):
|
|
|
548
551
|
)
|
|
549
552
|
self.assertEqual(
|
|
550
553
|
errors[0].hint,
|
|
551
|
-
"Add models.UniqueConstraint(fields=
|
|
552
|
-
'"image", "filter_spec", "focal_point_key"
|
|
554
|
+
"Add models.UniqueConstraint(fields=("
|
|
555
|
+
'"image", "filter_spec", "focal_point_key"), '
|
|
553
556
|
'name="unique_rendition") to CustomRendition.Meta.constraints.',
|
|
554
557
|
)
|
|
555
558
|
|
|
@@ -7,7 +7,7 @@ msgid ""
|
|
|
7
7
|
msgstr ""
|
|
8
8
|
"Project-Id-Version: Wagtail\n"
|
|
9
9
|
"Report-Msgid-Bugs-To: \n"
|
|
10
|
-
"POT-Creation-Date: 2025-04-
|
|
10
|
+
"POT-Creation-Date: 2025-04-25 23:05+0100\n"
|
|
11
11
|
"PO-Revision-Date: 2014-02-21 15:51+0000\n"
|
|
12
12
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
13
13
|
"Language-Team: Afrikaans (http://app.transifex.com/torchbox/wagtail/language/"
|
|
@@ -11,7 +11,7 @@ msgid ""
|
|
|
11
11
|
msgstr ""
|
|
12
12
|
"Project-Id-Version: Wagtail\n"
|
|
13
13
|
"Report-Msgid-Bugs-To: \n"
|
|
14
|
-
"POT-Creation-Date: 2025-04-
|
|
14
|
+
"POT-Creation-Date: 2025-04-25 23:05+0100\n"
|
|
15
15
|
"PO-Revision-Date: 2014-02-21 15:51+0000\n"
|
|
16
16
|
"Last-Translator: ultraify media <ultraify@gmail.com>, 2018\n"
|
|
17
17
|
"Language-Team: Arabic (http://app.transifex.com/torchbox/wagtail/language/"
|