wagtail 6.3.1__py3-none-any.whl → 6.4rc1__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.
Files changed (307) hide show
  1. wagtail/__init__.py +1 -1
  2. wagtail/actions/publish_revision.py +4 -5
  3. wagtail/admin/auth.py +0 -2
  4. wagtail/admin/checks.py +1 -1
  5. wagtail/admin/filters.py +3 -1
  6. wagtail/admin/forms/account.py +21 -11
  7. wagtail/admin/forms/collections.py +2 -9
  8. wagtail/admin/forms/formsets.py +32 -0
  9. wagtail/admin/forms/pages.py +5 -1
  10. wagtail/admin/forms/workflows.py +2 -13
  11. wagtail/admin/locale/ar/LC_MESSAGES/django.mo +0 -0
  12. wagtail/admin/locale/ar/LC_MESSAGES/django.po +68 -1
  13. wagtail/admin/locale/ar/LC_MESSAGES/djangojs.mo +0 -0
  14. wagtail/admin/locale/ar/LC_MESSAGES/djangojs.po +5 -1
  15. wagtail/admin/locale/en/LC_MESSAGES/django.po +312 -356
  16. wagtail/admin/locale/en/LC_MESSAGES/djangojs.po +21 -16
  17. wagtail/admin/locale/gl/LC_MESSAGES/djangojs.mo +0 -0
  18. wagtail/admin/locale/gl/LC_MESSAGES/djangojs.po +5 -5
  19. wagtail/admin/locale/pt_BR/LC_MESSAGES/django.mo +0 -0
  20. wagtail/admin/locale/pt_BR/LC_MESSAGES/django.po +29 -0
  21. wagtail/admin/menu.py +0 -13
  22. wagtail/admin/panels/base.py +2 -2
  23. wagtail/admin/panels/group.py +4 -1
  24. wagtail/admin/panels/inline_panel.py +5 -2
  25. wagtail/admin/panels/model_utils.py +36 -0
  26. wagtail/admin/panels/page_utils.py +2 -40
  27. wagtail/admin/panels/signal_handlers.py +0 -2
  28. wagtail/admin/static/wagtailadmin/css/core.css +1 -1
  29. wagtail/admin/static/wagtailadmin/css/panels/draftail.css +1 -1
  30. wagtail/admin/static/wagtailadmin/css/panels/streamfield.css +1 -1
  31. wagtail/admin/static/wagtailadmin/js/comments.js +1 -1
  32. wagtail/admin/static/wagtailadmin/js/core.js +1 -1
  33. wagtail/admin/static/wagtailadmin/js/core.js.LICENSE.txt +1 -8
  34. wagtail/admin/static/wagtailadmin/js/draftail.js +1 -1
  35. wagtail/admin/static/wagtailadmin/js/modal-workflow.js +1 -1
  36. wagtail/admin/static/wagtailadmin/js/page-chooser-modal.js +1 -1
  37. wagtail/admin/static/wagtailadmin/js/privacy-switch.js +1 -1
  38. wagtail/admin/static/wagtailadmin/js/sidebar.js +1 -1
  39. wagtail/admin/static/wagtailadmin/js/telepath/blocks.js +1 -1
  40. wagtail/admin/static/wagtailadmin/js/userbar.js +1 -1
  41. wagtail/admin/static/wagtailadmin/js/userbar.js.LICENSE.txt +1 -1
  42. wagtail/admin/static/wagtailadmin/js/vendor.js +1 -1
  43. wagtail/admin/static/wagtailadmin/js/vendor.js.LICENSE.txt +7 -0
  44. wagtail/admin/templates/wagtailadmin/404.html +4 -0
  45. wagtail/admin/templates/wagtailadmin/chooser/browse.html +2 -1
  46. wagtail/admin/templates/wagtailadmin/chooser/tables/parent_page_cell.html +1 -1
  47. wagtail/admin/templates/wagtailadmin/collections/_privacy_switch.html +8 -1
  48. wagtail/admin/templates/wagtailadmin/generic/confirm_delete.html +15 -9
  49. wagtail/admin/templates/wagtailadmin/generic/confirm_unpublish.html +21 -25
  50. wagtail/admin/templates/wagtailadmin/generic/form.html +1 -1
  51. wagtail/admin/templates/wagtailadmin/generic/preview_error.html +3 -0
  52. wagtail/admin/templates/wagtailadmin/generic/revisions/compare.html +63 -76
  53. wagtail/admin/templates/wagtailadmin/pages/_editor_js.html +0 -2
  54. wagtail/admin/templates/wagtailadmin/pages/edit.html +1 -5
  55. wagtail/admin/templates/wagtailadmin/panels/inline_panel_child.html +1 -0
  56. wagtail/admin/templates/wagtailadmin/permissions/includes/collection_member_permissions_form.html +1 -1
  57. wagtail/admin/templates/wagtailadmin/permissions/includes/collection_member_permissions_formset.html +6 -22
  58. wagtail/admin/templates/wagtailadmin/shared/formatted_field.html +2 -2
  59. wagtail/admin/templates/wagtailadmin/shared/header.html +2 -2
  60. wagtail/admin/templates/wagtailadmin/shared/page_status_tag_new.html +32 -39
  61. wagtail/admin/templates/wagtailadmin/shared/revisions/confirm_unschedule.html +13 -17
  62. wagtail/admin/templates/wagtailadmin/shared/side_panels/includes/status/privacy.html +15 -3
  63. wagtail/admin/templates/wagtailadmin/shared/side_panels/preview.html +1 -1
  64. wagtail/admin/templates/wagtailadmin/skeleton.html +4 -2
  65. wagtail/admin/templates/wagtailadmin/workflows/create.html +1 -1
  66. wagtail/admin/templates/wagtailadmin/workflows/edit.html +1 -1
  67. wagtail/admin/templates/wagtailadmin/workflows/includes/workflow_pages_form.html +1 -1
  68. wagtail/admin/templates/wagtailadmin/workflows/includes/workflow_pages_formset.html +6 -23
  69. wagtail/admin/templatetags/wagtailadmin_tags.py +12 -0
  70. wagtail/admin/templatetags/wagtailuserbar.py +2 -3
  71. wagtail/admin/tests/pages/test_create_page.py +110 -1
  72. wagtail/admin/tests/pages/test_edit_page.py +3 -2
  73. wagtail/admin/tests/pages/test_explorer_view.py +18 -0
  74. wagtail/admin/tests/pages/test_page_usage.py +24 -20
  75. wagtail/admin/tests/pages/test_preview.py +69 -1
  76. wagtail/admin/tests/pages/test_revisions.py +40 -6
  77. wagtail/admin/tests/test_account_management.py +39 -1
  78. wagtail/admin/tests/test_audit_log.py +4 -2
  79. wagtail/admin/tests/test_block_preview.py +224 -0
  80. wagtail/admin/tests/test_edit_handlers.py +23 -6
  81. wagtail/admin/tests/test_page_chooser.py +50 -3
  82. wagtail/admin/tests/test_privacy.py +49 -26
  83. wagtail/admin/tests/test_site_summary.py +15 -10
  84. wagtail/admin/tests/test_templatetags.py +19 -0
  85. wagtail/admin/tests/test_userbar.py +82 -1
  86. wagtail/admin/tests/test_views_generic.py +27 -12
  87. wagtail/admin/tests/test_workflows.py +69 -0
  88. wagtail/admin/tests/tests.py +23 -4
  89. wagtail/admin/tests/ui/test_sidebar.py +1 -1
  90. wagtail/admin/tests/viewsets/test_model_viewset.py +15 -13
  91. wagtail/admin/ui/side_panels.py +7 -4
  92. wagtail/admin/urls/__init__.py +6 -0
  93. wagtail/admin/urls/pages.py +1 -1
  94. wagtail/admin/userbar.py +21 -1
  95. wagtail/admin/views/account.py +5 -0
  96. wagtail/admin/views/chooser.py +5 -1
  97. wagtail/admin/views/collections.py +0 -2
  98. wagtail/admin/views/generic/base.py +20 -10
  99. wagtail/admin/views/generic/history.py +0 -1
  100. wagtail/admin/views/generic/models.py +79 -21
  101. wagtail/admin/views/generic/preview.py +50 -1
  102. wagtail/admin/views/mixins.py +4 -2
  103. wagtail/admin/views/pages/bulk_actions/delete.py +11 -23
  104. wagtail/admin/views/pages/bulk_actions/page_bulk_action.py +17 -0
  105. wagtail/admin/views/pages/bulk_actions/publish.py +11 -31
  106. wagtail/admin/views/pages/bulk_actions/unpublish.py +11 -31
  107. wagtail/admin/views/pages/create.py +1 -0
  108. wagtail/admin/views/pages/edit.py +38 -30
  109. wagtail/admin/views/pages/revisions.py +43 -114
  110. wagtail/admin/views/pages/utils.py +0 -1
  111. wagtail/admin/views/tags.py +6 -2
  112. wagtail/admin/views/workflows.py +8 -6
  113. wagtail/admin/viewsets/model.py +0 -4
  114. wagtail/admin/viewsets/pages.py +0 -1
  115. wagtail/admin/widgets/tags.py +1 -0
  116. wagtail/api/v2/tests/test_documents.py +4 -2
  117. wagtail/api/v2/tests/test_images.py +4 -2
  118. wagtail/api/v2/tests/test_pages.py +8 -4
  119. wagtail/blocks/base.py +59 -1
  120. wagtail/blocks/field_block.py +6 -0
  121. wagtail/blocks/list_block.py +4 -0
  122. wagtail/blocks/static_block.py +3 -0
  123. wagtail/blocks/stream_block.py +5 -1
  124. wagtail/blocks/struct_block.py +6 -0
  125. wagtail/compat.py +16 -0
  126. wagtail/contrib/forms/forms.py +27 -7
  127. wagtail/contrib/forms/locale/en/LC_MESSAGES/django.po +2 -2
  128. wagtail/contrib/forms/locale/gl/LC_MESSAGES/django.mo +0 -0
  129. wagtail/contrib/forms/locale/gl/LC_MESSAGES/django.po +4 -4
  130. wagtail/contrib/forms/tests/test_models.py +7 -5
  131. wagtail/contrib/forms/tests/test_views.py +75 -0
  132. wagtail/contrib/frontend_cache/backends/cloudfront.py +1 -1
  133. wagtail/contrib/frontend_cache/tasks.py +83 -0
  134. wagtail/contrib/frontend_cache/tests.py +48 -33
  135. wagtail/contrib/frontend_cache/utils.py +2 -70
  136. wagtail/contrib/redirects/base_formats.py +2 -2
  137. wagtail/contrib/redirects/locale/ar/LC_MESSAGES/django.mo +0 -0
  138. wagtail/contrib/redirects/locale/ar/LC_MESSAGES/django.po +3 -0
  139. wagtail/contrib/redirects/locale/en/LC_MESSAGES/django.po +24 -37
  140. wagtail/contrib/redirects/templates/wagtailredirects/add.html +1 -24
  141. wagtail/contrib/redirects/templates/wagtailredirects/confirm_delete.html +3 -13
  142. wagtail/contrib/redirects/tests/test_redirects.py +122 -110
  143. wagtail/contrib/redirects/tests/test_signal_handlers.py +75 -69
  144. wagtail/contrib/redirects/urls.py +2 -2
  145. wagtail/contrib/redirects/views.py +35 -73
  146. wagtail/contrib/search_promotions/admin_urls.py +10 -3
  147. wagtail/contrib/search_promotions/forms.py +55 -26
  148. wagtail/contrib/search_promotions/locale/en/LC_MESSAGES/django.po +44 -54
  149. wagtail/contrib/search_promotions/templates/wagtailsearchpromotions/add.html +21 -31
  150. wagtail/contrib/search_promotions/templates/wagtailsearchpromotions/confirm_delete.html +3 -12
  151. wagtail/contrib/search_promotions/templates/wagtailsearchpromotions/edit.html +11 -34
  152. wagtail/contrib/search_promotions/templates/wagtailsearchpromotions/includes/searchpromotion_form.html +1 -0
  153. wagtail/contrib/search_promotions/templates/wagtailsearchpromotions/includes/searchpromotions_formset.js +2 -1
  154. wagtail/contrib/search_promotions/templates/wagtailsearchpromotions/index.html +0 -1
  155. wagtail/contrib/search_promotions/tests.py +814 -13
  156. wagtail/contrib/search_promotions/views/__init__.py +1 -0
  157. wagtail/contrib/search_promotions/views/reports.py +56 -0
  158. wagtail/contrib/search_promotions/views/settings.py +258 -0
  159. wagtail/contrib/search_promotions/wagtail_hooks.py +12 -1
  160. wagtail/contrib/settings/locale/ar/LC_MESSAGES/django.mo +0 -0
  161. wagtail/contrib/settings/locale/ar/LC_MESSAGES/django.po +6 -1
  162. wagtail/contrib/settings/locale/en/LC_MESSAGES/django.po +3 -3
  163. wagtail/contrib/settings/templates/wagtailsettings/edit.html +1 -5
  164. wagtail/contrib/settings/tests/generic/test_admin.py +2 -5
  165. wagtail/contrib/settings/tests/generic/test_register.py +1 -1
  166. wagtail/contrib/settings/tests/site_specific/test_admin.py +2 -5
  167. wagtail/contrib/settings/tests/site_specific/test_register.py +1 -1
  168. wagtail/contrib/settings/views.py +9 -23
  169. wagtail/contrib/simple_translation/locale/en/LC_MESSAGES/django.po +1 -1
  170. wagtail/contrib/styleguide/locale/en/LC_MESSAGES/django.po +1 -1
  171. wagtail/contrib/table_block/locale/en/LC_MESSAGES/django.po +1 -1
  172. wagtail/contrib/table_block/tests.py +4 -1
  173. wagtail/contrib/typed_table_block/blocks.py +3 -0
  174. wagtail/contrib/typed_table_block/locale/en/LC_MESSAGES/django.po +10 -10
  175. wagtail/contrib/typed_table_block/static/typed_table_block/js/typed_table_block.js +1 -1
  176. wagtail/contrib/typed_table_block/tests.py +33 -0
  177. wagtail/documents/locale/en/LC_MESSAGES/django.po +26 -26
  178. wagtail/documents/migrations/0011_add_choose_permissions.py +1 -0
  179. wagtail/documents/models.py +1 -0
  180. wagtail/documents/signal_handlers.py +6 -2
  181. wagtail/documents/static/wagtaildocs/js/add-multiple.js +1 -1
  182. wagtail/documents/templates/wagtaildocs/documents/edit.html +1 -3
  183. wagtail/documents/templates/wagtaildocs/multiple/add.html +7 -1
  184. wagtail/documents/tests/test_admin_views.py +74 -33
  185. wagtail/documents/tests/test_views.py +21 -12
  186. wagtail/documents/views/chooser.py +1 -0
  187. wagtail/documents/views/documents.py +1 -2
  188. wagtail/documents/views/multiple.py +0 -1
  189. wagtail/documents/views/serve.py +9 -2
  190. wagtail/documents/wagtail_hooks.py +6 -1
  191. wagtail/embeds/locale/en/LC_MESSAGES/django.po +1 -1
  192. wagtail/embeds/oembed_providers.py +0 -64
  193. wagtail/fields.py +3 -0
  194. wagtail/images/apps.py +2 -1
  195. wagtail/images/blocks.py +14 -2
  196. wagtail/images/forms.py +40 -3
  197. wagtail/images/locale/ar/LC_MESSAGES/django.mo +0 -0
  198. wagtail/images/locale/ar/LC_MESSAGES/django.po +4 -0
  199. wagtail/images/locale/en/LC_MESSAGES/django.po +49 -49
  200. wagtail/images/migrations/0023_add_choose_permissions.py +1 -0
  201. wagtail/images/rich_text/contentstate.py +1 -0
  202. wagtail/images/rich_text/editor_html.py +1 -0
  203. wagtail/images/signal_handlers.py +17 -10
  204. wagtail/images/static/wagtailimages/js/add-multiple.js +1 -1
  205. wagtail/images/static/wagtailimages/js/image-block.js +1 -1
  206. wagtail/images/static/wagtailimages/js/image-chooser-telepath.js +1 -1
  207. wagtail/images/static/wagtailimages/js/image-chooser.js +1 -1
  208. wagtail/images/static/wagtailimages/js/image-url-generator.js +1 -1
  209. wagtail/images/static/wagtailimages/js/vendor/jquery.fileupload-image.js +1 -1
  210. wagtail/images/tasks.py +18 -0
  211. wagtail/images/templates/wagtailimages/images/edit.html +1 -3
  212. wagtail/images/templates/wagtailimages/images/url_generator.html +1 -1
  213. wagtail/images/templates/wagtailimages/multiple/add.html +7 -2
  214. wagtail/images/templates/wagtailimages/widgets/image_chooser.html +1 -1
  215. wagtail/images/tests/test_admin_views.py +53 -29
  216. wagtail/images/tests/test_blocks.py +34 -2
  217. wagtail/images/tests/test_models.py +12 -10
  218. wagtail/images/tests/tests.py +10 -0
  219. wagtail/images/views/chooser.py +1 -0
  220. wagtail/images/views/images.py +1 -3
  221. wagtail/images/views/multiple.py +0 -1
  222. wagtail/images/views/serve.py +18 -2
  223. wagtail/images/widgets.py +3 -0
  224. wagtail/locale/en/LC_MESSAGES/django.po +228 -216
  225. wagtail/locales/locale/en/LC_MESSAGES/django.po +1 -1
  226. wagtail/management/commands/publish_scheduled.py +1 -1
  227. wagtail/migrations/0087_alter_grouppagepermission_unique_together_and_more.py +16 -8
  228. wagtail/models/__init__.py +300 -119
  229. wagtail/models/i18n.py +2 -2
  230. wagtail/models/panels.py +37 -0
  231. wagtail/models/sites.py +7 -6
  232. wagtail/permission_policies/pages.py +2 -2
  233. wagtail/project_template/project_name/settings/base.py +4 -0
  234. wagtail/project_template/requirements.txt +1 -1
  235. wagtail/query.py +145 -0
  236. wagtail/search/backends/database/mysql/mysql.py +25 -17
  237. wagtail/search/backends/database/postgres/postgres.py +44 -83
  238. wagtail/search/backends/database/sqlite/sqlite.py +25 -17
  239. wagtail/search/backends/elasticsearch7.py +4 -0
  240. wagtail/search/locale/en/LC_MESSAGES/django.po +1 -1
  241. wagtail/search/query.py +8 -2
  242. wagtail/search/signal_handlers.py +6 -9
  243. wagtail/search/tasks.py +10 -0
  244. wagtail/search/tests/test_elasticsearch7_backend.py +21 -0
  245. wagtail/search/tests/test_index_functions.py +10 -6
  246. wagtail/search/tests/test_postgres_backend.py +0 -14
  247. wagtail/signal_handlers.py +5 -20
  248. wagtail/sites/locale/en/LC_MESSAGES/django.po +1 -1
  249. wagtail/snippets/locale/en/LC_MESSAGES/django.po +3 -13
  250. wagtail/snippets/locale/sv/LC_MESSAGES/django.mo +0 -0
  251. wagtail/snippets/locale/sv/LC_MESSAGES/django.po +4 -3
  252. wagtail/snippets/tests/test_preview.py +5 -0
  253. wagtail/snippets/tests/test_snippets.py +100 -45
  254. wagtail/snippets/tests/test_usage.py +29 -24
  255. wagtail/snippets/tests/test_viewset.py +1 -1
  256. wagtail/snippets/views/snippets.py +0 -12
  257. wagtail/tasks.py +41 -0
  258. wagtail/templates/wagtailcore/shared/block_preview.html +29 -0
  259. wagtail/test/earlypage/__init__.py +0 -0
  260. wagtail/test/earlypage/migrations/0001_initial.py +37 -0
  261. wagtail/test/earlypage/migrations/__init__.py +0 -0
  262. wagtail/test/earlypage/models.py +14 -0
  263. wagtail/test/settings.py +3 -0
  264. wagtail/test/testapp/fixtures/test.json +7 -0
  265. wagtail/test/testapp/fixtures/test_specific.json +6 -3
  266. wagtail/test/testapp/models.py +58 -44
  267. wagtail/test/testapp/templates/tests/custom_block_preview.html +16 -0
  268. wagtail/test/testapp/templates/tests/static_block_preview.html +5 -0
  269. wagtail/test/testapp/wagtail_hooks.py +9 -0
  270. wagtail/tests/test_blocks.py +189 -2
  271. wagtail/tests/test_hooks.py +166 -1
  272. wagtail/tests/test_management_commands.py +54 -13
  273. wagtail/tests/test_page_allowed_http_methods.py +32 -0
  274. wagtail/tests/test_page_model.py +68 -0
  275. wagtail/tests/test_page_privacy.py +10 -0
  276. wagtail/tests/test_page_queryset.py +79 -0
  277. wagtail/tests/test_reference_index.py +84 -75
  278. wagtail/tests/test_streamfield.py +30 -0
  279. wagtail/tests/test_utils.py +61 -0
  280. wagtail/users/forms.py +2 -9
  281. wagtail/users/locale/en/LC_MESSAGES/django.po +17 -17
  282. wagtail/users/locale/nl/LC_MESSAGES/django.mo +0 -0
  283. wagtail/users/locale/nl/LC_MESSAGES/django.po +4 -3
  284. wagtail/users/templates/wagtailusers/groups/create.html +0 -5
  285. wagtail/users/templates/wagtailusers/groups/includes/page_permissions_form.html +1 -1
  286. wagtail/users/templates/wagtailusers/groups/includes/page_permissions_formset.html +6 -6
  287. wagtail/users/tests/test_admin_views.py +96 -4
  288. wagtail/users/tests/test_utils.py +76 -0
  289. wagtail/users/utils.py +43 -11
  290. wagtail/utils/setup.py +2 -2
  291. wagtail/utils/templates.py +26 -0
  292. wagtail/utils/widgets.py +1 -0
  293. wagtail/views.py +9 -1
  294. wagtail/wagtail_hooks.py +67 -29
  295. {wagtail-6.3.1.dist-info → wagtail-6.4rc1.dist-info}/METADATA +2 -2
  296. {wagtail-6.3.1.dist-info → wagtail-6.4rc1.dist-info}/RECORD +300 -287
  297. wagtail/admin/static/wagtailadmin/js/expanding-formset.js +0 -1
  298. wagtail/admin/static/wagtailadmin/js/vendor/rangy-core.js +0 -1
  299. wagtail/admin/static/wagtailadmin/js/vendor/uuidv4.min.js +0 -1
  300. wagtail/contrib/search_promotions/views.py +0 -323
  301. wagtail/images/static/wagtailimages/js/vendor/canvas-to-blob.min.js +0 -1
  302. wagtail/users/static/wagtailusers/js/group-form.js +0 -1
  303. wagtail/users/templates/wagtailusers/groups/includes/group_form_js.html +0 -3
  304. {wagtail-6.3.1.dist-info → wagtail-6.4rc1.dist-info}/LICENSE +0 -0
  305. {wagtail-6.3.1.dist-info → wagtail-6.4rc1.dist-info}/WHEEL +0 -0
  306. {wagtail-6.3.1.dist-info → wagtail-6.4rc1.dist-info}/entry_points.txt +0 -0
  307. {wagtail-6.3.1.dist-info → wagtail-6.4rc1.dist-info}/top_level.txt +0 -0
@@ -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: 2024-10-21 17:53+0100\n"
11
+ "POT-Creation-Date: 2025-01-20 17:59+0000\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"
@@ -22,7 +22,7 @@ msgstr ""
22
22
  msgid "Wagtail redirects"
23
23
  msgstr ""
24
24
 
25
- #: filters.py:12 views.py:102 views.py:119
25
+ #: filters.py:12 views.py:100 views.py:117
26
26
  msgid "Type"
27
27
  msgstr ""
28
28
 
@@ -123,19 +123,14 @@ msgstr ""
123
123
  msgid "redirects"
124
124
  msgstr ""
125
125
 
126
- #: templates/wagtailredirects/add.html:3 templates/wagtailredirects/add.html:5
127
- #: views.py:70
128
- msgid "Add redirect"
129
- msgstr ""
130
-
131
- #: templates/wagtailredirects/choose_import_file.html:3 views.py:79
126
+ #: templates/wagtailredirects/choose_import_file.html:3 views.py:77
132
127
  #: wagtail_hooks.py:34
133
128
  msgid "Redirects"
134
129
  msgstr ""
135
130
 
136
131
  #: templates/wagtailredirects/choose_import_file.html:6
137
132
  #: templates/wagtailredirects/confirm_import.html:6
138
- #: templates/wagtailredirects/import_summary.html:5 views.py:130
133
+ #: templates/wagtailredirects/import_summary.html:5 views.py:128
139
134
  msgid "Import redirects"
140
135
  msgstr ""
141
136
 
@@ -157,17 +152,9 @@ msgid "Delete redirect %(title)s"
157
152
  msgstr ""
158
153
 
159
154
  #: templates/wagtailredirects/confirm_delete.html:5
160
- msgid "Delete"
161
- msgstr ""
162
-
163
- #: templates/wagtailredirects/confirm_delete.html:9
164
155
  msgid "Are you sure you want to delete this redirect?"
165
156
  msgstr ""
166
157
 
167
- #: templates/wagtailredirects/confirm_delete.html:12
168
- msgid "Yes, delete"
169
- msgstr ""
170
-
171
158
  #: templates/wagtailredirects/confirm_import.html:4
172
159
  #: templates/wagtailredirects/confirm_import.html:7
173
160
  msgid "Confirm import"
@@ -196,11 +183,11 @@ msgid ""
196
183
  "Found %(total)s redirects, created %(successes)s and found %(errors)s errors."
197
184
  msgstr ""
198
185
 
199
- #: templates/wagtailredirects/import_summary.html:17 views.py:84 views.py:116
186
+ #: templates/wagtailredirects/import_summary.html:17 views.py:82 views.py:114
200
187
  msgid "From"
201
188
  msgstr ""
202
189
 
203
- #: templates/wagtailredirects/import_summary.html:18 views.py:96 views.py:118
190
+ #: templates/wagtailredirects/import_summary.html:18 views.py:94 views.py:116
204
191
  msgid "To"
205
192
  msgstr ""
206
193
 
@@ -224,57 +211,57 @@ msgid ""
224
211
  "href=\"%(wagtailredirects_add_redirect_url)s\">add one</a>?"
225
212
  msgstr ""
226
213
 
227
- #: views.py:90 views.py:117
214
+ #: views.py:68
215
+ msgid "Add redirect"
216
+ msgstr ""
217
+
218
+ #: views.py:88 views.py:115
228
219
  msgid "Site"
229
220
  msgstr ""
230
221
 
231
- #: views.py:148
222
+ #: views.py:146
232
223
  msgid "The redirect could not be saved due to errors."
233
224
  msgstr ""
234
225
 
235
- #: views.py:153
226
+ #: views.py:150
236
227
  #, python-format
237
228
  msgid "Redirect '%(redirect_title)s' updated."
238
229
  msgstr ""
239
230
 
240
- #: views.py:190
231
+ #: views.py:183
241
232
  #, python-format
242
233
  msgid "Redirect '%(redirect_title)s' deleted."
243
234
  msgstr ""
244
235
 
245
- #: views.py:217
246
- #, python-format
247
- msgid "Redirect '%(redirect_title)s' added."
248
- msgstr ""
249
-
250
- #: views.py:222
251
- msgid "Edit"
236
+ #: views.py:196
237
+ msgid "The redirect could not be created due to errors."
252
238
  msgstr ""
253
239
 
254
- #: views.py:229
255
- msgid "The redirect could not be created due to errors."
240
+ #: views.py:200
241
+ #, python-format
242
+ msgid "Redirect '%(redirect_title)s' added."
256
243
  msgstr ""
257
244
 
258
- #: views.py:273
245
+ #: views.py:235
259
246
  msgid "Search redirects"
260
247
  msgstr ""
261
248
 
262
- #: views.py:287
249
+ #: views.py:249
263
250
  #, python-format
264
251
  msgid "File format of type \"%(extension)s\" is not supported"
265
252
  msgstr ""
266
253
 
267
- #: views.py:304
254
+ #: views.py:266
268
255
  #, python-format
269
256
  msgid "Imported file has a wrong encoding: %(error_message)s"
270
257
  msgstr ""
271
258
 
272
- #: views.py:311
259
+ #: views.py:273
273
260
  #, python-format
274
261
  msgid "%(error)s encountered while trying to read file: %(filename)s"
275
262
  msgstr ""
276
263
 
277
- #: views.py:402
264
+ #: views.py:364
278
265
  #, python-format
279
266
  msgid "Imported %(total)d redirect"
280
267
  msgid_plural "Imported %(total)d redirects"
@@ -1,24 +1 @@
1
- {% extends "wagtailadmin/generic/form.html" %}
2
- {% load i18n wagtailadmin_tags %}
3
- {% block titletag %}{% trans "Add redirect" %}{% endblock %}
4
- {% block content %}
5
- {% trans "Add redirect" as add_red_str %}
6
- {% include "wagtailadmin/shared/header.html" with title=add_red_str icon="redirect" %}
7
-
8
- {% include "wagtailadmin/shared/non_field_errors.html" %}
9
-
10
- <form action="{% url 'wagtailredirects:add' %}" method="POST" class="nice-padding" novalidate>
11
- {% csrf_token %}
12
-
13
- <ul class="fields">
14
- {% for field in form.visible_fields %}
15
- <li>{% formattedfield field %}</li>
16
- {% endfor %}
17
- </ul>
18
-
19
- {% block footer %}
20
- {{ block.super }}
21
- {% endblock %}
22
- </form>
23
-
24
- {% endblock %}
1
+ {% extends "wagtailadmin/generic/create.html" %}
@@ -1,16 +1,6 @@
1
- {% extends "wagtailadmin/base.html" %}
1
+ {% extends "wagtailadmin/generic/confirm_delete.html" %}
2
2
  {% load i18n %}
3
3
  {% block titletag %}{% blocktrans trimmed with title=redirect.title %}Delete redirect {{ title }}{% endblocktrans %}{% endblock %}
4
- {% block content %}
5
- {% trans "Delete" as delete_str %}
6
- {% include "wagtailadmin/shared/header.html" with title=delete_str subtitle=redirect.title icon="redirect" %}
7
-
8
- <div class="row row-flush nice-padding">
9
- <p>{% trans "Are you sure you want to delete this redirect?" %}</p>
10
- <form action="{% url 'wagtailredirects:delete' redirect.id %}" method="POST">
11
- {% csrf_token %}
12
- <input type="submit" value="{% trans 'Yes, delete' %}" class="button serious" />
13
- </form>
14
- </div>
15
-
4
+ {% block confirmation_message %}
5
+ <p>{% trans "Are you sure you want to delete this redirect?" %}</p>
16
6
  {% endblock %}
@@ -801,14 +801,15 @@ class TestRedirectsAddView(WagtailTestUtils, TestCase):
801
801
  self.assertTemplateUsed(response, "wagtailredirects/add.html")
802
802
 
803
803
  def test_add(self):
804
- response = self.post(
805
- {
806
- "old_path": "/test",
807
- "site": "",
808
- "is_permanent": "on",
809
- "redirect_link": "http://www.test.com/",
810
- }
811
- )
804
+ with self.captureOnCommitCallbacks(execute=True):
805
+ response = self.post(
806
+ {
807
+ "old_path": "/test",
808
+ "site": "",
809
+ "is_permanent": "on",
810
+ "redirect_link": "http://www.test.com/",
811
+ }
812
+ )
812
813
 
813
814
  # Should redirect back to index
814
815
  self.assertRedirects(response, reverse("wagtailredirects:index"))
@@ -827,15 +828,16 @@ class TestRedirectsAddView(WagtailTestUtils, TestCase):
827
828
  self.assertEqual(PURGED_URLS, {"http://localhost/test"})
828
829
 
829
830
  def test_add_with_site(self):
830
- localhost = Site.objects.get(hostname="localhost")
831
- response = self.post(
832
- {
833
- "old_path": "/test",
834
- "site": localhost.id,
835
- "is_permanent": "on",
836
- "redirect_link": "http://www.test.com/",
837
- }
838
- )
831
+ with self.captureOnCommitCallbacks(execute=True):
832
+ localhost = Site.objects.get(hostname="localhost")
833
+ response = self.post(
834
+ {
835
+ "old_path": "/test",
836
+ "site": localhost.id,
837
+ "is_permanent": "on",
838
+ "redirect_link": "http://www.test.com/",
839
+ }
840
+ )
839
841
 
840
842
  # Should redirect back to index
841
843
  self.assertRedirects(response, reverse("wagtailredirects:index"))
@@ -849,72 +851,76 @@ class TestRedirectsAddView(WagtailTestUtils, TestCase):
849
851
  self.assertEqual(PURGED_URLS, {"http://localhost/test"})
850
852
 
851
853
  def test_add_validation_error(self):
852
- response = self.post(
853
- {
854
- "old_path": "",
855
- "site": "",
856
- "is_permanent": "on",
857
- "redirect_link": "http://www.test.com/",
858
- }
859
- )
854
+ with self.captureOnCommitCallbacks(execute=True):
855
+ response = self.post(
856
+ {
857
+ "old_path": "",
858
+ "site": "",
859
+ "is_permanent": "on",
860
+ "redirect_link": "http://www.test.com/",
861
+ }
862
+ )
860
863
 
861
864
  # Should not redirect to index
862
865
  self.assertEqual(response.status_code, 200)
863
866
  self.assertEqual(PURGED_URLS, set())
864
867
 
865
868
  def test_cannot_add_duplicate_with_no_site(self):
866
- models.Redirect.objects.create(
867
- old_path="/test", site=None, redirect_link="http://elsewhere.com/"
868
- )
869
- response = self.post(
870
- {
871
- "old_path": "/test",
872
- "site": "",
873
- "is_permanent": "on",
874
- "redirect_link": "http://www.test.com/",
875
- }
876
- )
869
+ with self.captureOnCommitCallbacks(execute=True):
870
+ models.Redirect.objects.create(
871
+ old_path="/test", site=None, redirect_link="http://elsewhere.com/"
872
+ )
873
+ response = self.post(
874
+ {
875
+ "old_path": "/test",
876
+ "site": "",
877
+ "is_permanent": "on",
878
+ "redirect_link": "http://www.test.com/",
879
+ }
880
+ )
877
881
 
878
882
  # Should not redirect to index
879
883
  self.assertEqual(response.status_code, 200)
880
884
  self.assertEqual(PURGED_URLS, set())
881
885
 
882
886
  def test_cannot_add_duplicate_on_same_site(self):
883
- localhost = Site.objects.get(hostname="localhost")
884
- models.Redirect.objects.create(
885
- old_path="/test", site=localhost, redirect_link="http://elsewhere.com/"
886
- )
887
- response = self.post(
888
- {
889
- "old_path": "/test",
890
- "site": localhost.pk,
891
- "is_permanent": "on",
892
- "redirect_link": "http://www.test.com/",
893
- }
894
- )
887
+ with self.captureOnCommitCallbacks(execute=True):
888
+ localhost = Site.objects.get(hostname="localhost")
889
+ models.Redirect.objects.create(
890
+ old_path="/test", site=localhost, redirect_link="http://elsewhere.com/"
891
+ )
892
+ response = self.post(
893
+ {
894
+ "old_path": "/test",
895
+ "site": localhost.pk,
896
+ "is_permanent": "on",
897
+ "redirect_link": "http://www.test.com/",
898
+ }
899
+ )
895
900
 
896
901
  # Should not redirect to index
897
902
  self.assertEqual(response.status_code, 200)
898
903
  self.assertEqual(PURGED_URLS, set())
899
904
 
900
905
  def test_can_reuse_path_on_other_site(self):
901
- localhost = Site.objects.get(hostname="localhost")
902
- contact_page = Page.objects.get(url_path="/home/contact-us/")
903
- other_site = Site.objects.create(
904
- hostname="other.example.com", port=80, root_page=contact_page
905
- )
906
+ with self.captureOnCommitCallbacks(execute=True):
907
+ localhost = Site.objects.get(hostname="localhost")
908
+ contact_page = Page.objects.get(url_path="/home/contact-us/")
909
+ other_site = Site.objects.create(
910
+ hostname="other.example.com", port=80, root_page=contact_page
911
+ )
906
912
 
907
- models.Redirect.objects.create(
908
- old_path="/test", site=localhost, redirect_link="http://elsewhere.com/"
909
- )
910
- response = self.post(
911
- {
912
- "old_path": "/test",
913
- "site": other_site.pk,
914
- "is_permanent": "on",
915
- "redirect_link": "http://www.test.com/",
916
- }
917
- )
913
+ models.Redirect.objects.create(
914
+ old_path="/test", site=localhost, redirect_link="http://elsewhere.com/"
915
+ )
916
+ response = self.post(
917
+ {
918
+ "old_path": "/test",
919
+ "site": other_site.pk,
920
+ "is_permanent": "on",
921
+ "redirect_link": "http://www.test.com/",
922
+ }
923
+ )
918
924
 
919
925
  # Should redirect back to index
920
926
  self.assertRedirects(response, reverse("wagtailredirects:index"))
@@ -926,14 +932,15 @@ class TestRedirectsAddView(WagtailTestUtils, TestCase):
926
932
  self.assertEqual(PURGED_URLS, redirects.get().old_links())
927
933
 
928
934
  def test_add_long_redirect(self):
929
- response = self.post(
930
- {
931
- "old_path": "/test",
932
- "site": "",
933
- "is_permanent": "on",
934
- "redirect_link": "https://www.google.com/search?q=this+is+a+very+long+url+because+it+has+a+huge+search+term+appended+to+the+end+of+it+even+though+someone+should+really+not+be+doing+something+so+crazy+without+first+seeing+a+psychiatrist",
935
- }
936
- )
935
+ with self.captureOnCommitCallbacks(execute=True):
936
+ response = self.post(
937
+ {
938
+ "old_path": "/test",
939
+ "site": "",
940
+ "is_permanent": "on",
941
+ "redirect_link": "https://www.google.com/search?q=this+is+a+very+long+url+because+it+has+a+huge+search+term+appended+to+the+end+of+it+even+though+someone+should+really+not+be+doing+something+so+crazy+without+first+seeing+a+psychiatrist",
942
+ }
943
+ )
937
944
 
938
945
  # Should redirect back to index
939
946
  self.assertRedirects(response, reverse("wagtailredirects:index"))
@@ -1002,14 +1009,15 @@ class TestRedirectsEditView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
1002
1009
  self.assertEqual(self.get(redirect_id=100000).status_code, 404)
1003
1010
 
1004
1011
  def test_edit(self):
1005
- response = self.post(
1006
- {
1007
- "old_path": "/test",
1008
- "is_permanent": "on",
1009
- "site": "",
1010
- "redirect_link": "http://www.test.com/ive-been-edited",
1011
- }
1012
- )
1012
+ with self.captureOnCommitCallbacks(execute=True):
1013
+ response = self.post(
1014
+ {
1015
+ "old_path": "/test",
1016
+ "is_permanent": "on",
1017
+ "site": "",
1018
+ "redirect_link": "http://www.test.com/ive-been-edited",
1019
+ }
1020
+ )
1013
1021
 
1014
1022
  # Should redirect back to index
1015
1023
  self.assertRedirects(response, reverse("wagtailredirects:index"))
@@ -1025,16 +1033,17 @@ class TestRedirectsEditView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
1025
1033
  self.assertEqual(PURGED_URLS, {"http://localhost/test"})
1026
1034
 
1027
1035
  def test_edit_with_site(self):
1028
- localhost = Site.objects.get(hostname="localhost")
1029
-
1030
- response = self.post(
1031
- {
1032
- "old_path": "/test",
1033
- "is_permanent": "on",
1034
- "site": localhost.id,
1035
- "redirect_link": "http://www.test.com/ive-been-edited",
1036
- }
1037
- )
1036
+ with self.captureOnCommitCallbacks(execute=True):
1037
+ localhost = Site.objects.get(hostname="localhost")
1038
+
1039
+ response = self.post(
1040
+ {
1041
+ "old_path": "/test",
1042
+ "is_permanent": "on",
1043
+ "site": localhost.id,
1044
+ "redirect_link": "http://www.test.com/ive-been-edited",
1045
+ }
1046
+ )
1038
1047
 
1039
1048
  # Should redirect back to index
1040
1049
  self.assertRedirects(response, reverse("wagtailredirects:index"))
@@ -1049,31 +1058,33 @@ class TestRedirectsEditView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
1049
1058
  self.assertEqual(PURGED_URLS, {"http://localhost/test"})
1050
1059
 
1051
1060
  def test_edit_validation_error(self):
1052
- response = self.post(
1053
- {
1054
- "old_path": "",
1055
- "is_permanent": "on",
1056
- "site": "",
1057
- "redirect_link": "http://www.test.com/ive-been-edited",
1058
- }
1059
- )
1061
+ with self.captureOnCommitCallbacks(execute=True):
1062
+ response = self.post(
1063
+ {
1064
+ "old_path": "",
1065
+ "is_permanent": "on",
1066
+ "site": "",
1067
+ "redirect_link": "http://www.test.com/ive-been-edited",
1068
+ }
1069
+ )
1060
1070
 
1061
1071
  # Should not redirect to index
1062
1072
  self.assertEqual(response.status_code, 200)
1063
1073
  self.assertEqual(PURGED_URLS, set())
1064
1074
 
1065
1075
  def test_edit_duplicate(self):
1066
- models.Redirect.objects.create(
1067
- old_path="/othertest", site=None, redirect_link="http://elsewhere.com/"
1068
- )
1069
- response = self.post(
1070
- {
1071
- "old_path": "/othertest",
1072
- "is_permanent": "on",
1073
- "site": "",
1074
- "redirect_link": "http://www.test.com/ive-been-edited",
1075
- }
1076
- )
1076
+ with self.captureOnCommitCallbacks(execute=True):
1077
+ models.Redirect.objects.create(
1078
+ old_path="/othertest", site=None, redirect_link="http://elsewhere.com/"
1079
+ )
1080
+ response = self.post(
1081
+ {
1082
+ "old_path": "/othertest",
1083
+ "is_permanent": "on",
1084
+ "site": "",
1085
+ "redirect_link": "http://www.test.com/ive-been-edited",
1086
+ }
1087
+ )
1077
1088
 
1078
1089
  # Should not redirect to index
1079
1090
  self.assertEqual(response.status_code, 200)
@@ -1153,7 +1164,8 @@ class TestRedirectsDeleteView(WagtailTestUtils, TestCase):
1153
1164
  self.assertEqual(self.get(redirect_id=100000).status_code, 404)
1154
1165
 
1155
1166
  def test_delete(self):
1156
- response = self.post()
1167
+ with self.captureOnCommitCallbacks(execute=True):
1168
+ response = self.post()
1157
1169
 
1158
1170
  # Should redirect back to index
1159
1171
  self.assertRedirects(response, reverse("wagtailredirects:index"))