wagtail 7.1.2__py3-none-any.whl → 7.2rc1__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 (332) hide show
  1. wagtail/__init__.py +1 -1
  2. wagtail/actions/copy_page.py +1 -1
  3. wagtail/actions/create_alias.py +1 -1
  4. wagtail/actions/delete_page.py +1 -1
  5. wagtail/actions/publish_page_revision.py +1 -1
  6. wagtail/actions/publish_revision.py +1 -1
  7. wagtail/actions/revert_to_page_revision.py +1 -1
  8. wagtail/actions/unpublish.py +1 -1
  9. wagtail/actions/unpublish_page.py +1 -1
  10. wagtail/admin/auth.py +3 -1
  11. wagtail/admin/checks.py +2 -2
  12. wagtail/admin/filters.py +28 -1
  13. wagtail/admin/forms/collections.py +1 -1
  14. wagtail/admin/forms/comments.py +1 -1
  15. wagtail/admin/forms/models.py +1 -1
  16. wagtail/admin/forms/pages.py +1 -1
  17. wagtail/admin/forms/tags.py +1 -1
  18. wagtail/admin/locale/cs/LC_MESSAGES/django.mo +0 -0
  19. wagtail/admin/locale/cs/LC_MESSAGES/django.po +25 -1
  20. wagtail/admin/locale/en/LC_MESSAGES/django.po +278 -192
  21. wagtail/admin/locale/en/LC_MESSAGES/djangojs.po +29 -15
  22. wagtail/admin/locale/it/LC_MESSAGES/django.mo +0 -0
  23. wagtail/admin/locale/it/LC_MESSAGES/django.po +3 -2
  24. wagtail/admin/locale/nl/LC_MESSAGES/django.mo +0 -0
  25. wagtail/admin/locale/nl/LC_MESSAGES/django.po +57 -3
  26. wagtail/admin/locale/nl/LC_MESSAGES/djangojs.mo +0 -0
  27. wagtail/admin/locale/nl/LC_MESSAGES/djangojs.po +8 -2
  28. wagtail/admin/locale/ru/LC_MESSAGES/django.mo +0 -0
  29. wagtail/admin/locale/ru/LC_MESSAGES/django.po +58 -1
  30. wagtail/admin/locale/tr/LC_MESSAGES/django.mo +0 -0
  31. wagtail/admin/locale/tr/LC_MESSAGES/django.po +3 -2
  32. wagtail/admin/static/wagtailadmin/css/core.css +1 -1
  33. wagtail/admin/static/wagtailadmin/js/bulk-actions.js +1 -1
  34. wagtail/admin/static/wagtailadmin/js/chooser-modal.js +1 -1
  35. wagtail/admin/static/wagtailadmin/js/chooser-widget-telepath.js +1 -1
  36. wagtail/admin/static/wagtailadmin/js/chooser-widget.js +1 -1
  37. wagtail/admin/static/wagtailadmin/js/comments.js +1 -1
  38. wagtail/admin/static/wagtailadmin/js/core.js +1 -1
  39. wagtail/admin/static/wagtailadmin/js/core.js.LICENSE.txt +2 -2
  40. wagtail/admin/static/wagtailadmin/js/date-time-chooser.js +1 -1
  41. wagtail/admin/static/wagtailadmin/js/draftail.js +1 -1
  42. wagtail/admin/static/wagtailadmin/js/filtered-select.js +1 -1
  43. wagtail/admin/static/wagtailadmin/js/icons.js +1 -1
  44. wagtail/admin/static/wagtailadmin/js/modal-workflow.js +1 -1
  45. wagtail/admin/static/wagtailadmin/js/page-chooser-modal.js +1 -1
  46. wagtail/admin/static/wagtailadmin/js/page-chooser-telepath.js +1 -1
  47. wagtail/admin/static/wagtailadmin/js/page-chooser.js +1 -1
  48. wagtail/admin/static/wagtailadmin/js/privacy-switch.js +1 -1
  49. wagtail/admin/static/wagtailadmin/js/sidebar.js +1 -1
  50. wagtail/admin/static/wagtailadmin/js/task-chooser-modal.js +1 -1
  51. wagtail/admin/static/wagtailadmin/js/task-chooser.js +1 -1
  52. wagtail/admin/static/wagtailadmin/js/telepath/blocks.js +1 -1
  53. wagtail/admin/static/wagtailadmin/js/telepath/telepath.js +1 -1
  54. wagtail/admin/static/wagtailadmin/js/telepath/widgets.js +1 -1
  55. wagtail/admin/static/wagtailadmin/js/userbar.js +1 -1
  56. wagtail/admin/static/wagtailadmin/js/userbar.js.LICENSE.txt +2 -2
  57. wagtail/admin/static/wagtailadmin/js/vendor/bootstrap-modal.js +1 -1
  58. wagtail/admin/static/wagtailadmin/js/vendor/bootstrap-transition.js +1 -1
  59. wagtail/admin/static/wagtailadmin/js/vendor/jquery-3.6.0.min.js +1 -1
  60. wagtail/admin/static/wagtailadmin/js/vendor/jquery-ui-1.13.2.min.js +1 -1
  61. wagtail/admin/static/wagtailadmin/js/vendor/jquery.datetimepicker.js +1 -1
  62. wagtail/admin/static/wagtailadmin/js/vendor/jquery.fileupload-process.js +1 -1
  63. wagtail/admin/static/wagtailadmin/js/vendor/jquery.fileupload.js +1 -1
  64. wagtail/admin/static/wagtailadmin/js/vendor/jquery.iframe-transport.js +1 -1
  65. wagtail/admin/static/wagtailadmin/js/vendor/tag-it.js +1 -1
  66. wagtail/admin/static/wagtailadmin/js/vendor.js +1 -1
  67. wagtail/admin/static/wagtailadmin/js/vendor.js.LICENSE.txt +1 -1
  68. wagtail/admin/static/wagtailadmin/js/wagtailadmin.js +1 -1
  69. wagtail/admin/static/wagtailadmin/js/workflow-action.js +1 -1
  70. wagtail/admin/templates/wagtailadmin/account/account.html +2 -0
  71. wagtail/admin/templates/wagtailadmin/base.html +14 -0
  72. wagtail/admin/templates/wagtailadmin/generic/chooser/chooser.html +2 -1
  73. wagtail/admin/templates/wagtailadmin/generic/chooser/creation_form.html +2 -1
  74. wagtail/admin/templates/wagtailadmin/panels/multi_field_panel_child.html +1 -1
  75. wagtail/admin/templates/wagtailadmin/panels/object_list.html +1 -1
  76. wagtail/admin/templates/wagtailadmin/panels/tabbed_interface.html +3 -2
  77. wagtail/admin/templates/wagtailadmin/shared/formatted_field.html +1 -1
  78. wagtail/admin/templates/wagtailadmin/shared/forms/single_checkbox.html +1 -1
  79. wagtail/admin/templates/wagtailadmin/shared/keyboard_shortcuts_dialog.html +19 -0
  80. wagtail/admin/templates/wagtailadmin/shared/panel.html +1 -1
  81. wagtail/admin/templates/wagtailadmin/shared/set_privacy.html +15 -0
  82. wagtail/admin/templates/wagtailadmin/shared/side_panels/checks.html +28 -1
  83. wagtail/admin/templates/wagtailadmin/shared/workflow_history/detail.html +2 -2
  84. wagtail/admin/templates/wagtailadmin/{pages/listing/_ordering_header.html → tables/ordering_header.html} +2 -2
  85. wagtail/admin/templates/wagtailadmin/tables/title_cell.html +1 -1
  86. wagtail/admin/templates/wagtailadmin/widgets/{daterange_input.html → range_input.html} +1 -1
  87. wagtail/admin/templates/wagtailadmin/workflows/task_chooser/chooser.html +4 -2
  88. wagtail/admin/templatetags/wagtailadmin_tags.py +41 -22
  89. wagtail/admin/tests/api/test_pages.py +7 -7
  90. wagtail/admin/tests/api/test_renderer_classes.py +16 -0
  91. wagtail/admin/tests/pages/test_create_page.py +34 -2
  92. wagtail/admin/tests/pages/test_edit_page.py +128 -14
  93. wagtail/admin/tests/pages/test_explorer_view.py +34 -7
  94. wagtail/admin/tests/pages/test_reorder_page.py +11 -0
  95. wagtail/admin/tests/test_collections_views.py +12 -0
  96. wagtail/admin/tests/test_edit_handlers.py +3 -3
  97. wagtail/admin/tests/test_filters.py +2 -2
  98. wagtail/admin/tests/test_keyboard_shortcuts.py +52 -2
  99. wagtail/admin/tests/test_menu.py +0 -2
  100. wagtail/admin/tests/test_privacy.py +16 -16
  101. wagtail/admin/tests/test_templatetags.py +137 -0
  102. wagtail/admin/tests/test_workflows.py +34 -0
  103. wagtail/admin/tests/viewsets/test_model_viewset.py +322 -0
  104. wagtail/admin/ui/tables/orderable.py +73 -0
  105. wagtail/admin/ui/tables/pages.py +3 -13
  106. wagtail/admin/views/collection_privacy.py +6 -2
  107. wagtail/admin/views/generic/__init__.py +1 -0
  108. wagtail/admin/views/generic/mixins.py +20 -2
  109. wagtail/admin/views/generic/models.py +67 -1
  110. wagtail/admin/views/generic/ordering.py +79 -0
  111. wagtail/admin/views/home.py +3 -3
  112. wagtail/admin/views/page_privacy.py +5 -2
  113. wagtail/admin/views/pages/create.py +1 -1
  114. wagtail/admin/views/pages/edit.py +2 -2
  115. wagtail/admin/views/pages/listing.py +7 -42
  116. wagtail/admin/views/pages/move.py +1 -1
  117. wagtail/admin/views/pages/ordering.py +1 -1
  118. wagtail/admin/viewsets/base.py +1 -1
  119. wagtail/admin/viewsets/model.py +49 -1
  120. wagtail/admin/wagtail_hooks.py +2 -1
  121. wagtail/admin/widgets/slug.py +10 -10
  122. wagtail/api/v2/serializers.py +1 -1
  123. wagtail/api/v2/tests/test_renderer_classes.py +32 -0
  124. wagtail/apps.py +2 -0
  125. wagtail/bin/wagtail.py +1 -1
  126. wagtail/contrib/forms/locale/en/LC_MESSAGES/django.po +14 -14
  127. wagtail/contrib/forms/locale/nl/LC_MESSAGES/django.mo +0 -0
  128. wagtail/contrib/forms/locale/nl/LC_MESSAGES/django.po +19 -2
  129. wagtail/contrib/forms/locale/ru/LC_MESSAGES/django.mo +0 -0
  130. wagtail/contrib/forms/locale/ru/LC_MESSAGES/django.po +18 -1
  131. wagtail/contrib/frontend_cache/tests.py +4 -2
  132. wagtail/contrib/redirects/locale/en/LC_MESSAGES/django.po +4 -4
  133. wagtail/contrib/redirects/tests/test_tmp_storages.py +20 -0
  134. wagtail/contrib/redirects/tmp_storages.py +1 -1
  135. wagtail/contrib/redirects/views.py +3 -3
  136. wagtail/contrib/search_promotions/locale/en/LC_MESSAGES/django.po +3 -3
  137. wagtail/contrib/search_promotions/locale/tr/LC_MESSAGES/django.mo +0 -0
  138. wagtail/contrib/search_promotions/locale/tr/LC_MESSAGES/django.po +43 -3
  139. wagtail/contrib/search_promotions/static/wagtailsearchpromotions/js/query-chooser-modal.js +1 -1
  140. wagtail/contrib/search_promotions/views/settings.py +2 -2
  141. wagtail/contrib/settings/locale/cs/LC_MESSAGES/django.mo +0 -0
  142. wagtail/contrib/settings/locale/cs/LC_MESSAGES/django.po +6 -1
  143. wagtail/contrib/settings/locale/en/LC_MESSAGES/django.po +1 -1
  144. wagtail/contrib/settings/locale/nl/LC_MESSAGES/django.mo +0 -0
  145. wagtail/contrib/settings/locale/nl/LC_MESSAGES/django.po +6 -2
  146. wagtail/contrib/settings/locale/ru/LC_MESSAGES/django.mo +0 -0
  147. wagtail/contrib/settings/locale/ru/LC_MESSAGES/django.po +6 -1
  148. wagtail/contrib/settings/tests/site_specific/test_admin.py +40 -6
  149. wagtail/contrib/simple_translation/locale/en/LC_MESSAGES/django.po +1 -1
  150. wagtail/contrib/styleguide/locale/en/LC_MESSAGES/django.po +1 -1
  151. wagtail/contrib/styleguide/templates/wagtailstyleguide/base.html +5 -5
  152. wagtail/contrib/table_block/blocks.py +1 -0
  153. wagtail/contrib/table_block/locale/en/LC_MESSAGES/django.po +5 -1
  154. wagtail/contrib/table_block/static/table_block/js/table.js +1 -1
  155. wagtail/contrib/typed_table_block/locale/en/LC_MESSAGES/django.po +1 -1
  156. wagtail/contrib/typed_table_block/static/typed_table_block/js/typed_table_block.js +1 -1
  157. wagtail/coreutils.py +5 -5
  158. wagtail/documents/forms.py +18 -1
  159. wagtail/documents/locale/en/LC_MESSAGES/django.po +10 -10
  160. wagtail/documents/locale/nl/LC_MESSAGES/django.mo +0 -0
  161. wagtail/documents/locale/nl/LC_MESSAGES/django.po +9 -0
  162. wagtail/documents/locale/ru/LC_MESSAGES/django.mo +0 -0
  163. wagtail/documents/locale/ru/LC_MESSAGES/django.po +9 -0
  164. wagtail/documents/models.py +1 -1
  165. wagtail/documents/static/wagtaildocs/js/add-multiple.js +1 -1
  166. wagtail/documents/static/wagtaildocs/js/document-chooser-modal.js +1 -1
  167. wagtail/documents/static/wagtaildocs/js/document-chooser-telepath.js +1 -1
  168. wagtail/documents/static/wagtaildocs/js/document-chooser.js +1 -1
  169. wagtail/documents/templates/wagtaildocs/documents/add.html +0 -34
  170. wagtail/documents/tests/test_admin_views.py +132 -26
  171. wagtail/documents/tests/test_collection_privacy.py +18 -4
  172. wagtail/documents/tests/test_form_overrides.py +1 -1
  173. wagtail/documents/tests/test_search.py +21 -8
  174. wagtail/documents/views/documents.py +1 -1
  175. wagtail/embeds/locale/en/LC_MESSAGES/django.po +1 -1
  176. wagtail/embeds/static/wagtailembeds/js/embed-chooser-modal.js +1 -1
  177. wagtail/images/forms.py +16 -1
  178. wagtail/images/locale/cs/LC_MESSAGES/django.mo +0 -0
  179. wagtail/images/locale/cs/LC_MESSAGES/django.po +12 -1
  180. wagtail/images/locale/en/LC_MESSAGES/django.po +57 -46
  181. wagtail/images/locale/nl/LC_MESSAGES/django.mo +0 -0
  182. wagtail/images/locale/nl/LC_MESSAGES/django.po +37 -14
  183. wagtail/images/locale/ru/LC_MESSAGES/django.mo +0 -0
  184. wagtail/images/locale/ru/LC_MESSAGES/django.po +20 -1
  185. wagtail/images/models.py +1 -1
  186. wagtail/images/static/wagtailimages/js/add-multiple.js +1 -1
  187. wagtail/images/static/wagtailimages/js/focal-point-chooser.js +1 -1
  188. wagtail/images/static/wagtailimages/js/image-block.js +1 -1
  189. wagtail/images/static/wagtailimages/js/image-chooser-modal.js +1 -1
  190. wagtail/images/static/wagtailimages/js/image-chooser-telepath.js +1 -1
  191. wagtail/images/static/wagtailimages/js/image-chooser.js +1 -1
  192. wagtail/images/static/wagtailimages/js/image-url-generator.js +1 -1
  193. wagtail/images/static/wagtailimages/js/vendor/jquery.Jcrop.min.js +1 -1
  194. wagtail/images/static/wagtailimages/js/vendor/jquery.fileupload-image.js +1 -1
  195. wagtail/images/static/wagtailimages/js/vendor/jquery.fileupload-validate.js +1 -1
  196. wagtail/images/static/wagtailimages/js/vendor/load-image.min.js +1 -1
  197. wagtail/images/templates/wagtailimages/chooser/chooser.html +22 -13
  198. wagtail/images/templates/wagtailimages/chooser/image_preview_column_cell.html +10 -0
  199. wagtail/images/templates/wagtailimages/chooser/results.html +24 -20
  200. wagtail/images/templates/wagtailimages/chooser/title_column_cell.html +15 -0
  201. wagtail/images/templates/wagtailimages/images/add.html +0 -34
  202. wagtail/images/templates/wagtailimages/images/index.html +3 -3
  203. wagtail/images/templates/wagtailimages/images/index_results.html +1 -1
  204. wagtail/images/templates/wagtailimages/images/layout_toggle_button.html +8 -7
  205. wagtail/images/templatetags/wagtailimages_tags.py +2 -2
  206. wagtail/images/tests/test_admin_views.py +87 -0
  207. wagtail/images/tests/test_form_overrides.py +1 -1
  208. wagtail/images/tests/test_models.py +48 -9
  209. wagtail/images/views/chooser.py +66 -2
  210. wagtail/locale/en/LC_MESSAGES/django.po +55 -55
  211. wagtail/locale/is_IS/LC_MESSAGES/django.mo +0 -0
  212. wagtail/locale/is_IS/LC_MESSAGES/django.po +3 -3
  213. wagtail/locale/nl/LC_MESSAGES/django.mo +0 -0
  214. wagtail/locale/nl/LC_MESSAGES/django.po +11 -2
  215. wagtail/locale/ru/LC_MESSAGES/django.mo +0 -0
  216. wagtail/locale/ru/LC_MESSAGES/django.po +11 -1
  217. wagtail/locales/locale/en/LC_MESSAGES/django.po +1 -1
  218. wagtail/locales/locale/nl/LC_MESSAGES/django.mo +0 -0
  219. wagtail/locales/locale/nl/LC_MESSAGES/django.po +12 -1
  220. wagtail/locales/locale/ru/LC_MESSAGES/django.mo +0 -0
  221. wagtail/locales/locale/ru/LC_MESSAGES/django.po +10 -1
  222. wagtail/locales/views.py +2 -2
  223. wagtail/models/orderable.py +10 -0
  224. wagtail/models/pages.py +9 -11
  225. wagtail/models/sites.py +1 -1
  226. wagtail/models/workflows.py +8 -5
  227. wagtail/project_template/home/tests.py +6 -7
  228. wagtail/project_template/project_name/settings/base.py +9 -9
  229. wagtail/project_template/requirements.txt +1 -1
  230. wagtail/query.py +7 -2
  231. wagtail/rich_text/rewriters.py +1 -1
  232. wagtail/search/apps.py +4 -49
  233. wagtail/search/backends/__init__.py +1 -113
  234. wagtail/search/backends/base.py +1 -547
  235. wagtail/search/backends/database/__init__.py +1 -50
  236. wagtail/search/backends/database/fallback.py +1 -253
  237. wagtail/search/backends/database/mysql/mysql.py +1 -700
  238. wagtail/search/backends/database/mysql/query.py +1 -258
  239. wagtail/search/backends/database/postgres/postgres.py +1 -749
  240. wagtail/search/backends/database/postgres/query.py +1 -83
  241. wagtail/search/backends/database/postgres/weights.py +1 -63
  242. wagtail/search/backends/database/sqlite/query.py +1 -294
  243. wagtail/search/backends/database/sqlite/sqlite.py +1 -719
  244. wagtail/search/backends/database/sqlite/utils.py +1 -35
  245. wagtail/search/backends/deprecation.py +45 -0
  246. wagtail/search/backends/elasticsearch7.py +18 -1260
  247. wagtail/search/backends/elasticsearch8.py +21 -96
  248. wagtail/search/backends/elasticsearch9.py +35 -0
  249. wagtail/search/backends/opensearch2.py +35 -0
  250. wagtail/search/backends/opensearch3.py +35 -0
  251. wagtail/search/index.py +1 -358
  252. wagtail/search/locale/en/LC_MESSAGES/django.po +2 -10
  253. wagtail/search/management/commands/update_index.py +1 -205
  254. wagtail/search/management/commands/wagtail_update_index.py +1 -4
  255. wagtail/search/models.py +32 -158
  256. wagtail/search/query.py +1 -114
  257. wagtail/search/queryset.py +1 -43
  258. wagtail/search/signal_handlers.py +1 -24
  259. wagtail/search/tasks.py +1 -10
  260. wagtail/search/tests/test_elasticsearch.py +22 -0
  261. wagtail/search/utils.py +1 -206
  262. wagtail/sites/locale/en/LC_MESSAGES/django.po +1 -1
  263. wagtail/snippets/locale/en/LC_MESSAGES/django.po +3 -3
  264. wagtail/snippets/locale/ru/LC_MESSAGES/django.mo +0 -0
  265. wagtail/snippets/locale/ru/LC_MESSAGES/django.po +8 -1
  266. wagtail/snippets/locale/tr/LC_MESSAGES/django.mo +0 -0
  267. wagtail/snippets/locale/tr/LC_MESSAGES/django.po +8 -1
  268. wagtail/snippets/static/wagtailsnippets/js/snippet-chooser-telepath.js +1 -1
  269. wagtail/snippets/static/wagtailsnippets/js/snippet-chooser.js +1 -1
  270. wagtail/snippets/tests/test_reordering.py +319 -0
  271. wagtail/snippets/tests/test_snippets.py +65 -12
  272. wagtail/snippets/views/snippets.py +16 -0
  273. wagtail/test/numberformat.py +30 -0
  274. wagtail/test/settings.py +35 -12
  275. wagtail/test/testapp/fields.py +12 -0
  276. wagtail/test/testapp/migrations/0056_commentablejsonpage.py +50 -0
  277. wagtail/test/testapp/migrations/0057_featurecompletetoy_sort_order.py +23 -0
  278. wagtail/test/testapp/migrations/0058_customlocktask.py +31 -0
  279. wagtail/test/testapp/models.py +27 -0
  280. wagtail/test/testapp/views.py +3 -1
  281. wagtail/test/utils/page_tests.py +17 -17
  282. wagtail/test/utils/template_tests.py +4 -6
  283. wagtail/test/utils/wagtail_tests.py +1 -2
  284. wagtail/tests/test_page_model.py +15 -0
  285. wagtail/{search/tests → tests}/test_page_search.py +29 -2
  286. wagtail/tests/test_search_fields.py +69 -0
  287. wagtail/tests/test_tests.py +62 -6
  288. wagtail/tests/test_workflow.py +25 -1
  289. wagtail/users/locale/cs/LC_MESSAGES/django.mo +0 -0
  290. wagtail/users/locale/cs/LC_MESSAGES/django.po +3 -0
  291. wagtail/users/locale/en/LC_MESSAGES/django.po +2 -2
  292. wagtail/users/locale/nl/LC_MESSAGES/django.mo +0 -0
  293. wagtail/users/locale/nl/LC_MESSAGES/django.po +6 -3
  294. wagtail/users/locale/ru/LC_MESSAGES/django.mo +0 -0
  295. wagtail/users/locale/ru/LC_MESSAGES/django.po +5 -1
  296. wagtail/users/locale/tr/LC_MESSAGES/django.mo +0 -0
  297. wagtail/users/locale/tr/LC_MESSAGES/django.po +78 -4
  298. wagtail/users/templates/wagtailusers/users/create.html +2 -0
  299. wagtail/users/templates/wagtailusers/users/edit.html +2 -0
  300. wagtail/users/tests/test_admin_views.py +4 -0
  301. wagtail/users/views/users.py +1 -1
  302. {wagtail-7.1.2.dist-info → wagtail-7.2rc1.dist-info}/METADATA +7 -6
  303. {wagtail-7.1.2.dist-info → wagtail-7.2rc1.dist-info}/RECORD +309 -315
  304. wagtail/admin/templates/wagtailadmin/collection_privacy/set_privacy.html +0 -13
  305. wagtail/admin/templates/wagtailadmin/page_privacy/set_privacy.html +0 -13
  306. wagtail/search/tests/__init__.py +0 -0
  307. wagtail/search/tests/elasticsearch_common_tests.py +0 -251
  308. wagtail/search/tests/test_backends.py +0 -1215
  309. wagtail/search/tests/test_db_backend.py +0 -62
  310. wagtail/search/tests/test_elasticsearch7_backend.py +0 -1452
  311. wagtail/search/tests/test_elasticsearch8_backend.py +0 -15
  312. wagtail/search/tests/test_index_functions.py +0 -256
  313. wagtail/search/tests/test_indexed_class.py +0 -157
  314. wagtail/search/tests/test_mysql_backend.py +0 -192
  315. wagtail/search/tests/test_postgres_backend.py +0 -210
  316. wagtail/search/tests/test_queries.py +0 -332
  317. wagtail/search/tests/test_related_fields.py +0 -102
  318. wagtail/search/tests/test_sqlite_backend.py +0 -52
  319. wagtail/test/search/__init__.py +0 -0
  320. wagtail/test/search/apps.py +0 -9
  321. wagtail/test/search/fixtures/search.json +0 -545
  322. wagtail/test/search/migrations/0001_initial.py +0 -146
  323. wagtail/test/search/migrations/0002_bookunindexed.py +0 -43
  324. wagtail/test/search/migrations/0003_book_summary.py +0 -18
  325. wagtail/test/search/migrations/__init__.py +0 -0
  326. wagtail/test/search/models.py +0 -137
  327. /wagtail/admin/templates/wagtailadmin/{pages/listing/_ordering_cell.html → tables/ordering_cell.html} +0 -0
  328. /wagtail/{search/checks.py → checks.py} +0 -0
  329. {wagtail-7.1.2.dist-info → wagtail-7.2rc1.dist-info}/WHEEL +0 -0
  330. {wagtail-7.1.2.dist-info → wagtail-7.2rc1.dist-info}/entry_points.txt +0 -0
  331. {wagtail-7.1.2.dist-info → wagtail-7.2rc1.dist-info}/licenses/LICENSE +0 -0
  332. {wagtail-7.1.2.dist-info → wagtail-7.2rc1.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: 2025-07-24 16:20+0200\n"
11
+ "POT-Creation-Date: 2025-10-23 16:45+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"
@@ -22,7 +22,7 @@ msgstr ""
22
22
  msgid "Wagtail API v2"
23
23
  msgstr ""
24
24
 
25
- #: apps.py:8
25
+ #: apps.py:10
26
26
  msgid "Wagtail core"
27
27
  msgstr ""
28
28
 
@@ -211,7 +211,7 @@ msgid "Currently locked and will go live on the scheduled date"
211
211
  msgstr ""
212
212
 
213
213
  #: models/audit_log.py:191 models/pages.py:298 models/workflows.py:49
214
- #: models/workflows.py:656 models/workflows.py:996
214
+ #: models/workflows.py:656 models/workflows.py:998
215
215
  msgid "content type"
216
216
  msgstr ""
217
217
 
@@ -249,7 +249,7 @@ msgstr ""
249
249
  msgid "model log entries"
250
250
  msgstr ""
251
251
 
252
- #: models/draft_state.py:14 models/draft_state.py:92 models/workflows.py:1361
252
+ #: models/draft_state.py:14 models/draft_state.py:92 models/workflows.py:1363
253
253
  msgid "live"
254
254
  msgstr ""
255
255
 
@@ -277,23 +277,23 @@ msgstr ""
277
277
  msgid "expiry date/time"
278
278
  msgstr ""
279
279
 
280
- #: models/draft_state.py:42 models/draft_state.py:81 models/workflows.py:1346
280
+ #: models/draft_state.py:42 models/draft_state.py:81 models/workflows.py:1348
281
281
  msgid "expired"
282
282
  msgstr ""
283
283
 
284
- #: models/draft_state.py:83 models/workflows.py:1348
284
+ #: models/draft_state.py:83 models/workflows.py:1350
285
285
  msgid "scheduled"
286
286
  msgstr ""
287
287
 
288
- #: models/draft_state.py:85 models/workflows.py:1352
288
+ #: models/draft_state.py:85 models/workflows.py:1354
289
289
  msgid "draft"
290
290
  msgstr ""
291
291
 
292
- #: models/draft_state.py:88 models/workflows.py:1355
292
+ #: models/draft_state.py:88 models/workflows.py:1357
293
293
  msgid "live + scheduled"
294
294
  msgstr ""
295
295
 
296
- #: models/draft_state.py:90 models/workflows.py:1359
296
+ #: models/draft_state.py:90 models/workflows.py:1361
297
297
  msgid "live + draft"
298
298
  msgstr ""
299
299
 
@@ -334,11 +334,11 @@ msgstr ""
334
334
  msgid "collections"
335
335
  msgstr ""
336
336
 
337
- #: models/media.py:164 models/pages.py:2068 models/sites.py:287
337
+ #: models/media.py:164 models/pages.py:2066 models/sites.py:287
338
338
  msgid "group"
339
339
  msgstr ""
340
340
 
341
- #: models/media.py:175 models/pages.py:2080 models/sites.py:298
341
+ #: models/media.py:175 models/pages.py:2078 models/sites.py:298
342
342
  msgid "permission"
343
343
  msgstr ""
344
344
 
@@ -473,72 +473,72 @@ msgstr ""
473
473
  #, python-format
474
474
  msgid ""
475
475
  "The slug '%(page_slug)s' is already in use within the parent page at "
476
- "'%(parent_url_path)s'"
476
+ "'%(parent_url_path)s'."
477
477
  msgstr ""
478
478
 
479
- #: models/pages.py:2034 models/pages.py:2074 models/pages.py:2387
480
- #: models/pages.py:2454
479
+ #: models/pages.py:2032 models/pages.py:2072 models/pages.py:2385
480
+ #: models/pages.py:2452
481
481
  msgid "page"
482
482
  msgstr ""
483
483
 
484
- #: models/pages.py:2035
484
+ #: models/pages.py:2033
485
485
  msgid "pages"
486
486
  msgstr ""
487
487
 
488
- #: models/pages.py:2093
488
+ #: models/pages.py:2091
489
489
  msgid "group page permission"
490
490
  msgstr ""
491
491
 
492
- #: models/pages.py:2094
492
+ #: models/pages.py:2092
493
493
  msgid "group page permissions"
494
494
  msgstr ""
495
495
 
496
- #: models/pages.py:2395
496
+ #: models/pages.py:2393
497
497
  msgid "page view restriction"
498
498
  msgstr ""
499
499
 
500
- #: models/pages.py:2396
500
+ #: models/pages.py:2394
501
501
  msgid "page view restrictions"
502
502
  msgstr ""
503
503
 
504
- #: models/pages.py:2462 models/workflows.py:57 models/workflows.py:129
504
+ #: models/pages.py:2460 models/workflows.py:57 models/workflows.py:129
505
505
  #: models/workflows.py:614
506
506
  msgid "workflow"
507
507
  msgstr ""
508
508
 
509
- #: models/pages.py:2487
509
+ #: models/pages.py:2485
510
510
  msgid "workflow page"
511
511
  msgstr ""
512
512
 
513
- #: models/pages.py:2488
513
+ #: models/pages.py:2486
514
514
  msgid "workflow pages"
515
515
  msgstr ""
516
516
 
517
- #: models/pages.py:2555
517
+ #: models/pages.py:2553
518
518
  msgid "page log entry"
519
519
  msgstr ""
520
520
 
521
- #: models/pages.py:2556
521
+ #: models/pages.py:2554
522
522
  msgid "page log entries"
523
523
  msgstr ""
524
524
 
525
- #: models/pages.py:2574
525
+ #: models/pages.py:2572
526
526
  msgid "Draft saved"
527
527
  msgstr ""
528
528
 
529
- #: models/pages.py:2622
529
+ #: models/pages.py:2620
530
530
  msgid "comment"
531
531
  msgstr ""
532
532
 
533
- #: models/pages.py:2623
533
+ #: models/pages.py:2621
534
534
  msgid "comments"
535
535
  msgstr ""
536
536
 
537
- #: models/pages.py:2718
537
+ #: models/pages.py:2716
538
538
  msgid "comment reply"
539
539
  msgstr ""
540
540
 
541
- #: models/pages.py:2719
541
+ #: models/pages.py:2717
542
542
  msgid "comment replies"
543
543
  msgstr ""
544
544
 
@@ -610,7 +610,7 @@ msgstr ""
610
610
  msgid "approved go live at"
611
611
  msgstr ""
612
612
 
613
- #: models/revisions.py:234 models/workflows.py:966
613
+ #: models/revisions.py:234 models/workflows.py:968
614
614
  msgid "revision"
615
615
  msgstr ""
616
616
 
@@ -712,7 +712,7 @@ msgid ""
712
712
  "has this password will be able to view the content."
713
713
  msgstr ""
714
714
 
715
- #: models/view_restrictions.py:36 models/workflows.py:820
715
+ #: models/view_restrictions.py:36 models/workflows.py:822
716
716
  msgid "groups"
717
717
  msgstr ""
718
718
 
@@ -724,11 +724,11 @@ msgstr ""
724
724
  msgid "view restrictions"
725
725
  msgstr ""
726
726
 
727
- #: models/workflows.py:107 models/workflows.py:950
727
+ #: models/workflows.py:107 models/workflows.py:952
728
728
  msgid "In progress"
729
729
  msgstr ""
730
730
 
731
- #: models/workflows.py:108 models/workflows.py:951 wagtail_hooks.py:155
731
+ #: models/workflows.py:108 models/workflows.py:953 wagtail_hooks.py:155
732
732
  msgid "Approved"
733
733
  msgstr ""
734
734
 
@@ -736,11 +736,11 @@ msgstr ""
736
736
  msgid "Needs changes"
737
737
  msgstr ""
738
738
 
739
- #: models/workflows.py:110 models/workflows.py:954
739
+ #: models/workflows.py:110 models/workflows.py:956
740
740
  msgid "Cancelled"
741
741
  msgstr ""
742
742
 
743
- #: models/workflows.py:134 models/workflows.py:977
743
+ #: models/workflows.py:134 models/workflows.py:979
744
744
  msgid "status"
745
745
  msgstr ""
746
746
 
@@ -793,7 +793,7 @@ msgstr ""
793
793
  msgid "workflow_tasks"
794
794
  msgstr ""
795
795
 
796
- #: models/workflows.py:633 models/workflows.py:813 models/workflows.py:972
796
+ #: models/workflows.py:633 models/workflows.py:815 models/workflows.py:974
797
797
  msgid "task"
798
798
  msgstr ""
799
799
 
@@ -811,82 +811,82 @@ msgid ""
811
811
  "it from existing workflows."
812
812
  msgstr ""
813
813
 
814
- #: models/workflows.py:814
814
+ #: models/workflows.py:816
815
815
  msgid "tasks"
816
816
  msgstr ""
817
817
 
818
- #: models/workflows.py:822
818
+ #: models/workflows.py:824
819
819
  msgid ""
820
820
  "Pages/snippets at this step in a workflow will be moderated or approved by "
821
821
  "these groups of users"
822
822
  msgstr ""
823
823
 
824
- #: models/workflows.py:881
824
+ #: models/workflows.py:883
825
825
  msgid "Request changes"
826
826
  msgstr ""
827
827
 
828
- #: models/workflows.py:882 wagtail_hooks.py:155
828
+ #: models/workflows.py:884 wagtail_hooks.py:155
829
829
  msgid "Approve"
830
830
  msgstr ""
831
831
 
832
- #: models/workflows.py:883
832
+ #: models/workflows.py:885
833
833
  msgid "Approve with comment"
834
834
  msgstr ""
835
835
 
836
- #: models/workflows.py:896
836
+ #: models/workflows.py:898
837
837
  msgid "Members of the chosen Wagtail Groups can approve this task"
838
838
  msgstr ""
839
839
 
840
- #: models/workflows.py:900
840
+ #: models/workflows.py:902
841
841
  msgid "Group approval task"
842
842
  msgstr ""
843
843
 
844
- #: models/workflows.py:901
844
+ #: models/workflows.py:903
845
845
  msgid "Group approval tasks"
846
846
  msgstr ""
847
847
 
848
- #: models/workflows.py:952 wagtail_hooks.py:156
848
+ #: models/workflows.py:954 wagtail_hooks.py:156
849
849
  msgid "Rejected"
850
850
  msgstr ""
851
851
 
852
- #: models/workflows.py:953
852
+ #: models/workflows.py:955
853
853
  msgid "Skipped"
854
854
  msgstr ""
855
855
 
856
- #: models/workflows.py:960
856
+ #: models/workflows.py:962
857
857
  msgid "workflow state"
858
858
  msgstr ""
859
859
 
860
- #: models/workflows.py:981
860
+ #: models/workflows.py:983
861
861
  msgid "started at"
862
862
  msgstr ""
863
863
 
864
- #: models/workflows.py:983
864
+ #: models/workflows.py:985
865
865
  msgid "finished at"
866
866
  msgstr ""
867
867
 
868
- #: models/workflows.py:987
868
+ #: models/workflows.py:989
869
869
  msgid "finished by"
870
870
  msgstr ""
871
871
 
872
- #: models/workflows.py:1016
872
+ #: models/workflows.py:1018
873
873
  #, python-format
874
874
  msgid "Task '%(task_name)s' on Revision '%(revision_info)s': %(status)s"
875
875
  msgstr ""
876
876
 
877
- #: models/workflows.py:1157
877
+ #: models/workflows.py:1159
878
878
  msgid "Task state"
879
879
  msgstr ""
880
880
 
881
- #: models/workflows.py:1158
881
+ #: models/workflows.py:1160
882
882
  msgid "Task states"
883
883
  msgstr ""
884
884
 
885
- #: models/workflows.py:1350
885
+ #: models/workflows.py:1352
886
886
  msgid "in moderation"
887
887
  msgstr ""
888
888
 
889
- #: models/workflows.py:1357
889
+ #: models/workflows.py:1359
890
890
  msgid "live + in moderation"
891
891
  msgstr ""
892
892
 
Binary file
@@ -4,14 +4,14 @@
4
4
  #
5
5
  # Translators:
6
6
  # Arnar Tumi Þorsteinsson <arnartumi@gmail.com>, 2015-2018,2020-2021,2023-2024
7
- # saevarom <saevar@saevar.is>, 2019-2024
7
+ # saevarom <saevar@saevar.is>, 2019-2025
8
8
  msgid ""
9
9
  msgstr ""
10
10
  "Project-Id-Version: Wagtail\n"
11
11
  "Report-Msgid-Bugs-To: \n"
12
12
  "POT-Creation-Date: 2025-07-24 16:20+0200\n"
13
13
  "PO-Revision-Date: 2014-02-21 15:51+0000\n"
14
- "Last-Translator: saevarom <saevar@saevar.is>, 2019-2024\n"
14
+ "Last-Translator: saevarom <saevar@saevar.is>, 2019-2025\n"
15
15
  "Language-Team: Icelandic (Iceland) (http://app.transifex.com/torchbox/"
16
16
  "wagtail/language/is_IS/)\n"
17
17
  "MIME-Version: 1.0\n"
@@ -382,7 +382,7 @@ msgid "page"
382
382
  msgstr "síða"
383
383
 
384
384
  msgid "pages"
385
- msgstr "íður"
385
+ msgstr "síður"
386
386
 
387
387
  msgid "group page permission"
388
388
  msgstr "síðuheimild hóps"
Binary file
@@ -9,7 +9,7 @@
9
9
  # Maarten Kling <kling.maarten@gmail.com>, 2023
10
10
  # Matt Westcott <matthew@torchbox.com>, 2023
11
11
  # Meteor0id, 2018,2021
12
- # Storm Heg <storm@stormbase.digital>, 2021-2024
12
+ # Storm Heg <storm@stormbase.digital>, 2021-2025
13
13
  # Thijs Kramer <thijskramer@gmail.com>, 2015
14
14
  # Thijs Kramer <thijskramer@gmail.com>, 2015-2016,2022-2023
15
15
  msgid ""
@@ -18,7 +18,7 @@ msgstr ""
18
18
  "Report-Msgid-Bugs-To: \n"
19
19
  "POT-Creation-Date: 2025-07-24 16:20+0200\n"
20
20
  "PO-Revision-Date: 2014-02-21 15:51+0000\n"
21
- "Last-Translator: Thijs Kramer <thijskramer@gmail.com>, 2015-2016,2022-2023\n"
21
+ "Last-Translator: Storm Heg <storm@stormbase.digital>, 2021-2025\n"
22
22
  "Language-Team: Dutch (http://app.transifex.com/torchbox/wagtail/language/"
23
23
  "nl/)\n"
24
24
  "MIME-Version: 1.0\n"
@@ -84,6 +84,9 @@ msgstr "Wagtail sitemaps"
84
84
  msgid "Unknown content type"
85
85
  msgstr "Onbekend content type"
86
86
 
87
+ msgid "Date cannot be in the future."
88
+ msgstr "Datum kan niet in de toekomst liggen."
89
+
87
90
  msgid "Password"
88
91
  msgstr "Wachtwoord"
89
92
 
@@ -549,6 +552,12 @@ msgstr ""
549
552
  "%(hostname)s is al geconfigureerd als de default site. Deze moet worden "
550
553
  "aangepast voordat deze site als default kan worden aangemerkt."
551
554
 
555
+ msgid "group site permission"
556
+ msgstr "groep site machtiging"
557
+
558
+ msgid "group site permissions"
559
+ msgstr "groep site machtigingen"
560
+
552
561
  msgid "Public"
553
562
  msgstr "Publiek"
554
563
 
Binary file
@@ -21,6 +21,7 @@
21
21
  # Sergey Khalymon <sergiykhalimon@gmail.com>, 2015
22
22
  # 2a01ec1f91c141c338f53ad8cc23abc6_8deca2d, 2021
23
23
  # Sergey Khalymon <sergiykhalimon@gmail.com>, 2015
24
+ # Twixxik, 2025
24
25
  # Виктор Виктор <spam.vitek@gmail.com>, 2020
25
26
  # Влад <integration.into.society@gmail.com>, 2021-2022
26
27
  # Мирон Левицкий <miron200504@gmail.com>, 2018
@@ -33,7 +34,7 @@ msgstr ""
33
34
  "Report-Msgid-Bugs-To: \n"
34
35
  "POT-Creation-Date: 2025-07-24 16:20+0200\n"
35
36
  "PO-Revision-Date: 2014-02-21 15:51+0000\n"
36
- "Last-Translator: 2a01ec1f91c141c338f53ad8cc23abc6_8deca2d, 2021\n"
37
+ "Last-Translator: Twixxik, 2025\n"
37
38
  "Language-Team: Russian (http://app.transifex.com/torchbox/wagtail/language/"
38
39
  "ru/)\n"
39
40
  "MIME-Version: 1.0\n"
@@ -101,6 +102,9 @@ msgstr "Карта сайта Wagtail"
101
102
  msgid "Unknown content type"
102
103
  msgstr "Неизвестный тип контента."
103
104
 
105
+ msgid "Date cannot be in the future."
106
+ msgstr "Дата не может быть из будущего"
107
+
104
108
  msgid "Password"
105
109
  msgstr "Пароль"
106
110
 
@@ -565,6 +569,12 @@ msgstr ""
565
569
  "%(hostname)s уже настроен как сайт по умолчанию. Вы должны сначала отключить "
566
570
  "эту настройку у него, прежде, чем вы можете сохранить этот сайт по умолчанию."
567
571
 
572
+ msgid "group site permission"
573
+ msgstr "Разрешение группы на сайт"
574
+
575
+ msgid "group site permissions"
576
+ msgstr "Разрешения группы на сайт"
577
+
568
578
  msgid "Public"
569
579
  msgstr "Публично"
570
580
 
@@ -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-07-24 16:20+0200\n"
11
+ "POT-Creation-Date: 2025-10-23 16:45+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"
@@ -5,6 +5,7 @@
5
5
  #
6
6
  # Translators:
7
7
  # Loic Teixeira, 2022
8
+ # Storm Heg <storm@stormbase.digital>, 2025
8
9
  #
9
10
  #, fuzzy
10
11
  msgid ""
@@ -13,7 +14,7 @@ msgstr ""
13
14
  "Report-Msgid-Bugs-To: \n"
14
15
  "POT-Creation-Date: 2025-07-24 16:20+0200\n"
15
16
  "PO-Revision-Date: 2020-10-23 10:41+0000\n"
16
- "Last-Translator: Loic Teixeira, 2022\n"
17
+ "Last-Translator: Storm Heg <storm@stormbase.digital>, 2025\n"
17
18
  "Language-Team: Dutch (https://app.transifex.com/torchbox/teams/8009/nl/)\n"
18
19
  "MIME-Version: 1.0\n"
19
20
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -46,6 +47,16 @@ msgstr ""
46
47
  "De taalcode van de huidige taalregio wordt niet ondersteund. Kies een andere "
47
48
  "taal of verwijder deze taalregio."
48
49
 
50
+ #, python-format
51
+ msgid "%(num_pages)d pages and %(num_others)d others"
52
+ msgstr "%(num_pages)d pagina's en %(num_others)d anderen"
53
+
54
+ #, python-format
55
+ msgid "%(num_pages)d page"
56
+ msgid_plural "%(num_pages)d pages"
57
+ msgstr[0] "%(num_pages)d pagina"
58
+ msgstr[1] "%(num_pages)d pagina's"
59
+
49
60
  msgid "Locales"
50
61
  msgstr "Taalregio's"
51
62
 
@@ -7,6 +7,7 @@
7
7
  # Виктор Виктор <spam.vitek@gmail.com>, 2020
8
8
  # sergeybe <sergeybe@gmail.com>, 2020
9
9
  # Loic Teixeira, 2022
10
+ # Twixxik, 2025
10
11
  #
11
12
  #, fuzzy
12
13
  msgid ""
@@ -15,7 +16,7 @@ msgstr ""
15
16
  "Report-Msgid-Bugs-To: \n"
16
17
  "POT-Creation-Date: 2025-07-24 16:20+0200\n"
17
18
  "PO-Revision-Date: 2020-10-23 10:41+0000\n"
18
- "Last-Translator: Loic Teixeira, 2022\n"
19
+ "Last-Translator: Twixxik, 2025\n"
19
20
  "Language-Team: Russian (https://app.transifex.com/torchbox/teams/8009/ru/)\n"
20
21
  "MIME-Version: 1.0\n"
21
22
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -50,6 +51,14 @@ msgstr ""
50
51
  "Текущий код языка локали не поддерживается. Пожалуйста выберите новый язык "
51
52
  "или удалите эту локаль."
52
53
 
54
+ #, python-format
55
+ msgid "%(num_pages)d page"
56
+ msgid_plural "%(num_pages)d pages"
57
+ msgstr[0] "%(num_pages)d страница "
58
+ msgstr[1] "%(num_pages)d страницы"
59
+ msgstr[2] "%(num_pages)d страниц"
60
+ msgstr[3] "%(num_pages)d страниц"
61
+
53
62
  msgid "Locales"
54
63
  msgstr "Локали"
55
64
 
wagtail/locales/views.py CHANGED
@@ -1,4 +1,4 @@
1
- from typing import TYPE_CHECKING, Any, Optional
1
+ from typing import TYPE_CHECKING, Any
2
2
 
3
3
  from django.core.exceptions import PermissionDenied
4
4
  from django.utils.translation import gettext_lazy, ngettext_lazy
@@ -62,7 +62,7 @@ class IndexView(generic.IndexView):
62
62
  LocaleUsageColumn("usage", label=gettext_lazy("Usage")),
63
63
  ]
64
64
 
65
- def get_add_url(self) -> Optional[str]:
65
+ def get_add_url(self) -> str | None:
66
66
  # Removes the "Add" button from the index view.
67
67
  if not _can_add_locale():
68
68
  return None
@@ -8,3 +8,13 @@ class Orderable(models.Model):
8
8
  class Meta:
9
9
  abstract = True
10
10
  ordering = ["sort_order"]
11
+
12
+
13
+ def set_max_order(instance, sort_order_field):
14
+ # Get the maximum value, defaulting to 0 if no records exist
15
+ aggregate = instance.__class__._default_manager.aggregate(
16
+ max_order=models.Max(sort_order_field)
17
+ )
18
+ max_order = aggregate["max_order"] or 0
19
+ setattr(instance, sort_order_field, max_order + 1)
20
+ instance.save(update_fields=[sort_order_field])
wagtail/models/pages.py CHANGED
@@ -663,7 +663,7 @@ class Page(AbstractPage, index.Indexed, ClusterableModel, metaclass=PageBase):
663
663
  raise ValidationError(
664
664
  {
665
665
  "slug": _(
666
- "The slug '%(page_slug)s' is already in use within the parent page at '%(parent_url_path)s'"
666
+ "The slug '%(page_slug)s' is already in use within the parent page at '%(parent_url_path)s'."
667
667
  )
668
668
  % {"page_slug": self.slug, "parent_url_path": parent_page.url}
669
669
  }
@@ -719,10 +719,6 @@ class Page(AbstractPage, index.Indexed, ClusterableModel, metaclass=PageBase):
719
719
  :meth:`~django.db.models.Model.full_clean` before saving.
720
720
 
721
721
  If ``clean=True`` is passed, and the page has ``live=False`` set, only the title and slug fields are validated.
722
-
723
- .. versionchanged:: 7.0
724
- ``clean=True`` now only performs full validation when the page is live. When the page is not live, only
725
- the title and slug fields are validated. Previously, full validation was always performed.
726
722
  """
727
723
  if clean:
728
724
  if self.live:
@@ -743,7 +739,9 @@ class Page(AbstractPage, index.Indexed, ClusterableModel, metaclass=PageBase):
743
739
  # Check that we are committing the slug to the database
744
740
  # Basically: If update_fields has been specified, and slug is not included, skip this step
745
741
  if not (
746
- "update_fields" in kwargs and "slug" not in kwargs["update_fields"]
742
+ "update_fields" in kwargs
743
+ and kwargs["update_fields"] is not None
744
+ and "slug" not in kwargs["update_fields"]
747
745
  ):
748
746
  # see if the slug has changed from the record in the db, in which case we need to
749
747
  # update url_path of self and all descendants. Even though we might not need it,
@@ -903,7 +901,7 @@ class Page(AbstractPage, index.Indexed, ClusterableModel, metaclass=PageBase):
903
901
  # Cache the parent page on the subpage to avoid another db query
904
902
  # Treebeard's get_parent will use the `_cached_parent_obj` attribute if it exists
905
903
  # And update = False
906
- setattr(subpage, "_cached_parent_obj", self)
904
+ subpage._cached_parent_obj = self
907
905
 
908
906
  except Page.DoesNotExist:
909
907
  raise Http404
@@ -2693,12 +2691,12 @@ class Comment(ClusterableModel):
2693
2691
  # comment applies to the field as a whole
2694
2692
  return True
2695
2693
 
2696
- if not isinstance(field, StreamField):
2697
- # only StreamField supports content paths that are deeper than one level
2694
+ # e.g. StreamField supports content paths that are deeper than one level
2695
+ if not hasattr(field, "get_block_by_content_path"):
2698
2696
  return False
2699
2697
 
2700
- stream_value = getattr(page, field_name)
2701
- block = field.get_block_by_content_path(stream_value, remainder)
2698
+ field_value = getattr(page, field_name)
2699
+ block = field.get_block_by_content_path(field_value, remainder)
2702
2700
  # content path is valid if this returns a BoundBlock rather than None
2703
2701
  return bool(block)
2704
2702
 
wagtail/models/sites.py CHANGED
@@ -156,7 +156,7 @@ class Site(models.Model):
156
156
 
157
157
  if not hasattr(request, "_wagtail_site"):
158
158
  site = Site._find_for_request(request)
159
- setattr(request, "_wagtail_site", site)
159
+ request._wagtail_site = site
160
160
  return request._wagtail_site
161
161
 
162
162
  @staticmethod
@@ -666,6 +666,8 @@ class Task(SpecificMixin, models.Model):
666
666
  )
667
667
  objects = TaskManager()
668
668
 
669
+ lock_class = WorkflowLock
670
+
669
671
  admin_form_fields = ["name"]
670
672
  admin_form_readonly_on_edit_fields = ["name"]
671
673
 
@@ -1363,10 +1365,11 @@ class WorkflowMixin(models.Model):
1363
1365
  def get_lock(self):
1364
1366
  # Standard locking should take precedence over workflow locking
1365
1367
  # because it's possible for both to be used at the same time
1366
- lock = super().get_lock()
1367
- if lock:
1368
+ if lock := super().get_lock():
1368
1369
  return lock
1369
1370
 
1370
- current_workflow_task = self.current_workflow_task
1371
- if current_workflow_task:
1372
- return WorkflowLock(self, current_workflow_task)
1371
+ if current_workflow_task := self.current_workflow_task:
1372
+ lock_class = current_workflow_task.lock_class
1373
+ return lock_class(self, current_workflow_task)
1374
+
1375
+ return None
@@ -1,7 +1,6 @@
1
- from django.urls import reverse
2
1
  from home.models import HomePage
3
2
 
4
- from wagtail.models import Page
3
+ from wagtail.models import Page, Site
5
4
  from wagtail.test.utils import WagtailPageTestCase
6
5
 
7
6
 
@@ -30,14 +29,14 @@ class HomeTests(WagtailPageTestCase):
30
29
  """
31
30
  Create a homepage instance for testing.
32
31
  """
33
- root_page = Page.objects.get(pk=1)
32
+ root_page = Page.get_first_root_node()
33
+ Site.objects.create(hostname="testsite", root_page=root_page, is_default_site=True)
34
34
  self.homepage = HomePage(title="Home")
35
35
  root_page.add_child(instance=self.homepage)
36
36
 
37
- def test_homepage_status_code(self):
38
- response = self.client.get(reverse("home"))
39
- self.assertEqual(response.status_code, 200)
37
+ def test_homepage_is_renderable(self):
38
+ self.assertPageIsRenderable(self.homepage)
40
39
 
41
40
  def test_homepage_template_used(self):
42
- response = self.client.get(reverse("home"))
41
+ response = self.client.get(self.homepage.url)
43
42
  self.assertTemplateUsed(response, "home/home_page.html")