wagtail 6.4.1__py3-none-any.whl → 7.0rc1__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 (1199) hide show
  1. wagtail/__init__.py +1 -1
  2. wagtail/actions/copy_page.py +4 -4
  3. wagtail/admin/action_menu.py +3 -0
  4. wagtail/admin/active_filters.py +218 -0
  5. wagtail/admin/auth.py +3 -39
  6. wagtail/admin/forms/choosers.py +8 -7
  7. wagtail/admin/forms/models.py +46 -1
  8. wagtail/admin/forms/pages.py +9 -0
  9. wagtail/admin/locale/ar/LC_MESSAGES/django.mo +0 -0
  10. wagtail/admin/locale/ar/LC_MESSAGES/django.po +30 -12
  11. wagtail/admin/locale/ar/LC_MESSAGES/djangojs.mo +0 -0
  12. wagtail/admin/locale/ar/LC_MESSAGES/djangojs.po +5 -1
  13. wagtail/admin/locale/az_AZ/LC_MESSAGES/django.po +1 -1
  14. wagtail/admin/locale/be/LC_MESSAGES/django.mo +0 -0
  15. wagtail/admin/locale/be/LC_MESSAGES/django.po +27 -13
  16. wagtail/admin/locale/be/LC_MESSAGES/djangojs.mo +0 -0
  17. wagtail/admin/locale/be/LC_MESSAGES/djangojs.po +3 -0
  18. wagtail/admin/locale/bg/LC_MESSAGES/django.mo +0 -0
  19. wagtail/admin/locale/bg/LC_MESSAGES/django.po +3 -3
  20. wagtail/admin/locale/bn/LC_MESSAGES/django.po +1 -1
  21. wagtail/admin/locale/ca/LC_MESSAGES/django.mo +0 -0
  22. wagtail/admin/locale/ca/LC_MESSAGES/django.po +30 -28
  23. wagtail/admin/locale/ca/LC_MESSAGES/djangojs.mo +0 -0
  24. wagtail/admin/locale/ca/LC_MESSAGES/djangojs.po +3 -0
  25. wagtail/admin/locale/cs/LC_MESSAGES/django.mo +0 -0
  26. wagtail/admin/locale/cs/LC_MESSAGES/django.po +30 -19
  27. wagtail/admin/locale/cs/LC_MESSAGES/djangojs.mo +0 -0
  28. wagtail/admin/locale/cs/LC_MESSAGES/djangojs.po +5 -2
  29. wagtail/admin/locale/cy/LC_MESSAGES/django.po +1 -1
  30. wagtail/admin/locale/cy/LC_MESSAGES/djangojs.mo +0 -0
  31. wagtail/admin/locale/cy/LC_MESSAGES/djangojs.po +3 -0
  32. wagtail/admin/locale/da/LC_MESSAGES/django.po +4 -4
  33. wagtail/admin/locale/de/LC_MESSAGES/django.mo +0 -0
  34. wagtail/admin/locale/de/LC_MESSAGES/django.po +33 -30
  35. wagtail/admin/locale/de/LC_MESSAGES/djangojs.mo +0 -0
  36. wagtail/admin/locale/de/LC_MESSAGES/djangojs.po +5 -1
  37. wagtail/admin/locale/dv/LC_MESSAGES/django.mo +0 -0
  38. wagtail/admin/locale/dv/LC_MESSAGES/django.po +7 -18
  39. wagtail/admin/locale/dv/LC_MESSAGES/djangojs.mo +0 -0
  40. wagtail/admin/locale/dv/LC_MESSAGES/djangojs.po +3 -0
  41. wagtail/admin/locale/el/LC_MESSAGES/django.mo +0 -0
  42. wagtail/admin/locale/el/LC_MESSAGES/django.po +9 -8
  43. wagtail/admin/locale/el/LC_MESSAGES/djangojs.mo +0 -0
  44. wagtail/admin/locale/el/LC_MESSAGES/djangojs.po +5 -2
  45. wagtail/admin/locale/en/LC_MESSAGES/django.po +386 -319
  46. wagtail/admin/locale/en/LC_MESSAGES/djangojs.po +11 -7
  47. wagtail/admin/locale/es/LC_MESSAGES/django.mo +0 -0
  48. wagtail/admin/locale/es/LC_MESSAGES/django.po +32 -22
  49. wagtail/admin/locale/es/LC_MESSAGES/djangojs.mo +0 -0
  50. wagtail/admin/locale/es/LC_MESSAGES/djangojs.po +5 -2
  51. wagtail/admin/locale/es_419/LC_MESSAGES/django.po +2 -1
  52. wagtail/admin/locale/es_VE/LC_MESSAGES/django.po +2 -1
  53. wagtail/admin/locale/et/LC_MESSAGES/django.mo +0 -0
  54. wagtail/admin/locale/et/LC_MESSAGES/django.po +30 -19
  55. wagtail/admin/locale/et/LC_MESSAGES/djangojs.mo +0 -0
  56. wagtail/admin/locale/et/LC_MESSAGES/djangojs.po +3 -0
  57. wagtail/admin/locale/eu/LC_MESSAGES/django.po +1 -1
  58. wagtail/admin/locale/fa/LC_MESSAGES/django.mo +0 -0
  59. wagtail/admin/locale/fa/LC_MESSAGES/django.po +10 -9
  60. wagtail/admin/locale/fa/LC_MESSAGES/djangojs.mo +0 -0
  61. wagtail/admin/locale/fa/LC_MESSAGES/djangojs.po +5 -2
  62. wagtail/admin/locale/fi/LC_MESSAGES/django.mo +0 -0
  63. wagtail/admin/locale/fi/LC_MESSAGES/django.po +30 -21
  64. wagtail/admin/locale/fi/LC_MESSAGES/djangojs.mo +0 -0
  65. wagtail/admin/locale/fi/LC_MESSAGES/djangojs.po +5 -2
  66. wagtail/admin/locale/fr/LC_MESSAGES/django.mo +0 -0
  67. wagtail/admin/locale/fr/LC_MESSAGES/django.po +80 -24
  68. wagtail/admin/locale/fr/LC_MESSAGES/djangojs.mo +0 -0
  69. wagtail/admin/locale/fr/LC_MESSAGES/djangojs.po +3 -0
  70. wagtail/admin/locale/gl/LC_MESSAGES/django.mo +0 -0
  71. wagtail/admin/locale/gl/LC_MESSAGES/django.po +75 -22
  72. wagtail/admin/locale/gl/LC_MESSAGES/djangojs.mo +0 -0
  73. wagtail/admin/locale/gl/LC_MESSAGES/djangojs.po +3 -0
  74. wagtail/admin/locale/he_IL/LC_MESSAGES/django.mo +0 -0
  75. wagtail/admin/locale/he_IL/LC_MESSAGES/django.po +5 -5
  76. wagtail/admin/locale/hr_HR/LC_MESSAGES/django.mo +0 -0
  77. wagtail/admin/locale/hr_HR/LC_MESSAGES/django.po +30 -19
  78. wagtail/admin/locale/hr_HR/LC_MESSAGES/djangojs.mo +0 -0
  79. wagtail/admin/locale/hr_HR/LC_MESSAGES/djangojs.po +3 -0
  80. wagtail/admin/locale/ht/LC_MESSAGES/django.po +1 -1
  81. wagtail/admin/locale/hu/LC_MESSAGES/django.mo +0 -0
  82. wagtail/admin/locale/hu/LC_MESSAGES/django.po +350 -25
  83. wagtail/admin/locale/hu/LC_MESSAGES/djangojs.mo +0 -0
  84. wagtail/admin/locale/hu/LC_MESSAGES/djangojs.po +8 -0
  85. wagtail/admin/locale/id_ID/LC_MESSAGES/django.mo +0 -0
  86. wagtail/admin/locale/id_ID/LC_MESSAGES/django.po +11 -11
  87. wagtail/admin/locale/is_IS/LC_MESSAGES/django.mo +0 -0
  88. wagtail/admin/locale/is_IS/LC_MESSAGES/django.po +30 -29
  89. wagtail/admin/locale/is_IS/LC_MESSAGES/djangojs.mo +0 -0
  90. wagtail/admin/locale/is_IS/LC_MESSAGES/djangojs.po +5 -2
  91. wagtail/admin/locale/it/LC_MESSAGES/django.mo +0 -0
  92. wagtail/admin/locale/it/LC_MESSAGES/django.po +30 -29
  93. wagtail/admin/locale/it/LC_MESSAGES/djangojs.mo +0 -0
  94. wagtail/admin/locale/it/LC_MESSAGES/djangojs.po +5 -2
  95. wagtail/admin/locale/ja/LC_MESSAGES/django.mo +0 -0
  96. wagtail/admin/locale/ja/LC_MESSAGES/django.po +14 -15
  97. wagtail/admin/locale/ja/LC_MESSAGES/djangojs.mo +0 -0
  98. wagtail/admin/locale/ja/LC_MESSAGES/djangojs.po +5 -2
  99. wagtail/admin/locale/ka/LC_MESSAGES/django.po +1 -1
  100. wagtail/admin/locale/ko/LC_MESSAGES/django.mo +0 -0
  101. wagtail/admin/locale/ko/LC_MESSAGES/django.po +92 -19
  102. wagtail/admin/locale/ko/LC_MESSAGES/djangojs.mo +0 -0
  103. wagtail/admin/locale/ko/LC_MESSAGES/djangojs.po +16 -0
  104. wagtail/admin/locale/lt/LC_MESSAGES/django.mo +0 -0
  105. wagtail/admin/locale/lt/LC_MESSAGES/django.po +30 -15
  106. wagtail/admin/locale/lt/LC_MESSAGES/djangojs.mo +0 -0
  107. wagtail/admin/locale/lt/LC_MESSAGES/djangojs.po +3 -0
  108. wagtail/admin/locale/lv/LC_MESSAGES/django.mo +0 -0
  109. wagtail/admin/locale/lv/LC_MESSAGES/django.po +10 -9
  110. wagtail/admin/locale/lv/LC_MESSAGES/djangojs.mo +0 -0
  111. wagtail/admin/locale/lv/LC_MESSAGES/djangojs.po +3 -0
  112. wagtail/admin/locale/mi/LC_MESSAGES/django.po +1 -1
  113. wagtail/admin/locale/mi/LC_MESSAGES/djangojs.mo +0 -0
  114. wagtail/admin/locale/mi/LC_MESSAGES/djangojs.po +3 -0
  115. wagtail/admin/locale/mn/LC_MESSAGES/django.mo +0 -0
  116. wagtail/admin/locale/mn/LC_MESSAGES/django.po +12 -11
  117. wagtail/admin/locale/my/LC_MESSAGES/django.po +1 -1
  118. wagtail/admin/locale/nb/LC_MESSAGES/django.mo +0 -0
  119. wagtail/admin/locale/nb/LC_MESSAGES/django.po +31 -15
  120. wagtail/admin/locale/nb/LC_MESSAGES/djangojs.mo +0 -0
  121. wagtail/admin/locale/nb/LC_MESSAGES/djangojs.po +5 -2
  122. wagtail/admin/locale/nl/LC_MESSAGES/django.mo +0 -0
  123. wagtail/admin/locale/nl/LC_MESSAGES/django.po +32 -29
  124. wagtail/admin/locale/nl/LC_MESSAGES/djangojs.mo +0 -0
  125. wagtail/admin/locale/nl/LC_MESSAGES/djangojs.po +5 -2
  126. wagtail/admin/locale/pl/LC_MESSAGES/django.mo +0 -0
  127. wagtail/admin/locale/pl/LC_MESSAGES/django.po +30 -22
  128. wagtail/admin/locale/pl/LC_MESSAGES/djangojs.mo +0 -0
  129. wagtail/admin/locale/pl/LC_MESSAGES/djangojs.po +3 -0
  130. wagtail/admin/locale/pt_BR/LC_MESSAGES/django.mo +0 -0
  131. wagtail/admin/locale/pt_BR/LC_MESSAGES/django.po +33 -28
  132. wagtail/admin/locale/pt_BR/LC_MESSAGES/djangojs.mo +0 -0
  133. wagtail/admin/locale/pt_BR/LC_MESSAGES/djangojs.po +3 -0
  134. wagtail/admin/locale/pt_PT/LC_MESSAGES/django.mo +0 -0
  135. wagtail/admin/locale/pt_PT/LC_MESSAGES/django.po +31 -18
  136. wagtail/admin/locale/pt_PT/LC_MESSAGES/djangojs.mo +0 -0
  137. wagtail/admin/locale/pt_PT/LC_MESSAGES/djangojs.po +5 -2
  138. wagtail/admin/locale/ro/LC_MESSAGES/django.mo +0 -0
  139. wagtail/admin/locale/ro/LC_MESSAGES/django.po +30 -28
  140. wagtail/admin/locale/ro/LC_MESSAGES/djangojs.mo +0 -0
  141. wagtail/admin/locale/ro/LC_MESSAGES/djangojs.po +5 -2
  142. wagtail/admin/locale/ru/LC_MESSAGES/django.mo +0 -0
  143. wagtail/admin/locale/ru/LC_MESSAGES/django.po +34 -29
  144. wagtail/admin/locale/ru/LC_MESSAGES/djangojs.mo +0 -0
  145. wagtail/admin/locale/ru/LC_MESSAGES/djangojs.po +5 -2
  146. wagtail/admin/locale/sk_SK/LC_MESSAGES/django.mo +0 -0
  147. wagtail/admin/locale/sk_SK/LC_MESSAGES/django.po +6 -6
  148. wagtail/admin/locale/sk_SK/LC_MESSAGES/djangojs.mo +0 -0
  149. wagtail/admin/locale/sk_SK/LC_MESSAGES/djangojs.po +3 -0
  150. wagtail/admin/locale/sl/LC_MESSAGES/django.mo +0 -0
  151. wagtail/admin/locale/sl/LC_MESSAGES/django.po +31 -27
  152. wagtail/admin/locale/sl/LC_MESSAGES/djangojs.mo +0 -0
  153. wagtail/admin/locale/sl/LC_MESSAGES/djangojs.po +3 -0
  154. wagtail/admin/locale/sv/LC_MESSAGES/django.mo +0 -0
  155. wagtail/admin/locale/sv/LC_MESSAGES/django.po +30 -18
  156. wagtail/admin/locale/sv/LC_MESSAGES/djangojs.mo +0 -0
  157. wagtail/admin/locale/sv/LC_MESSAGES/djangojs.po +5 -2
  158. wagtail/admin/locale/tet/LC_MESSAGES/django.mo +0 -0
  159. wagtail/admin/locale/tet/LC_MESSAGES/django.po +5 -5
  160. wagtail/admin/locale/tet/LC_MESSAGES/djangojs.mo +0 -0
  161. wagtail/admin/locale/tet/LC_MESSAGES/djangojs.po +5 -2
  162. wagtail/admin/locale/th/LC_MESSAGES/django.mo +0 -0
  163. wagtail/admin/locale/th/LC_MESSAGES/django.po +10 -17
  164. wagtail/admin/locale/tr/LC_MESSAGES/django.mo +0 -0
  165. wagtail/admin/locale/tr/LC_MESSAGES/django.po +28 -13
  166. wagtail/admin/locale/tr/LC_MESSAGES/djangojs.mo +0 -0
  167. wagtail/admin/locale/tr/LC_MESSAGES/djangojs.po +5 -2
  168. wagtail/admin/locale/tr_TR/LC_MESSAGES/django.mo +0 -0
  169. wagtail/admin/locale/tr_TR/LC_MESSAGES/django.po +28 -13
  170. wagtail/admin/locale/tr_TR/LC_MESSAGES/djangojs.mo +0 -0
  171. wagtail/admin/locale/tr_TR/LC_MESSAGES/djangojs.po +5 -2
  172. wagtail/admin/locale/ug/LC_MESSAGES/django.mo +0 -0
  173. wagtail/admin/locale/ug/LC_MESSAGES/django.po +12 -29
  174. wagtail/admin/locale/ug/LC_MESSAGES/djangojs.mo +0 -0
  175. wagtail/admin/locale/ug/LC_MESSAGES/djangojs.po +3 -0
  176. wagtail/admin/locale/uk/LC_MESSAGES/django.mo +0 -0
  177. wagtail/admin/locale/uk/LC_MESSAGES/django.po +30 -26
  178. wagtail/admin/locale/uk/LC_MESSAGES/djangojs.mo +0 -0
  179. wagtail/admin/locale/uk/LC_MESSAGES/djangojs.po +6 -3
  180. wagtail/admin/locale/vi/LC_MESSAGES/django.po +2 -1
  181. wagtail/admin/locale/zh/LC_MESSAGES/django.mo +0 -0
  182. wagtail/admin/locale/zh/LC_MESSAGES/django.po +2 -2
  183. wagtail/admin/locale/zh_Hans/LC_MESSAGES/django.mo +0 -0
  184. wagtail/admin/locale/zh_Hans/LC_MESSAGES/django.po +33 -18
  185. wagtail/admin/locale/zh_Hans/LC_MESSAGES/djangojs.mo +0 -0
  186. wagtail/admin/locale/zh_Hans/LC_MESSAGES/djangojs.po +5 -2
  187. wagtail/admin/locale/zh_Hant/LC_MESSAGES/django.mo +0 -0
  188. wagtail/admin/locale/zh_Hant/LC_MESSAGES/django.po +11 -14
  189. wagtail/admin/locale/zh_Hant/LC_MESSAGES/djangojs.mo +0 -0
  190. wagtail/admin/locale/zh_Hant/LC_MESSAGES/djangojs.po +3 -0
  191. wagtail/admin/localization.py +42 -1
  192. wagtail/admin/menu.py +1 -10
  193. wagtail/admin/paginator.py +95 -0
  194. wagtail/admin/panels/field_panel.py +27 -6
  195. wagtail/admin/panels/inline_panel.py +28 -11
  196. wagtail/admin/panels/multiple_chooser_panel.py +3 -3
  197. wagtail/admin/rich_text/converters/html_to_contentstate.py +6 -6
  198. wagtail/admin/search.py +1 -10
  199. wagtail/admin/static/wagtailadmin/css/core.css +1 -1
  200. wagtail/admin/static/wagtailadmin/css/panels/draftail.css +1 -1
  201. wagtail/admin/static/wagtailadmin/js/bulk-actions.js +1 -1
  202. wagtail/admin/static/wagtailadmin/js/comments.js +1 -1
  203. wagtail/admin/static/wagtailadmin/js/core.js +1 -1
  204. wagtail/admin/static/wagtailadmin/js/draftail.js +1 -1
  205. wagtail/admin/static/wagtailadmin/js/sidebar.js +1 -1
  206. wagtail/admin/static/wagtailadmin/js/telepath/blocks.js +1 -1
  207. wagtail/admin/static/wagtailadmin/js/telepath/widgets.js +1 -1
  208. wagtail/admin/static/wagtailadmin/js/vendor.js +1 -1
  209. wagtail/admin/static/wagtailadmin/js/vendor.js.LICENSE.txt +32 -11
  210. wagtail/admin/static/wagtailadmin/js/workflow-action.js +1 -1
  211. wagtail/admin/templates/wagtailadmin/admin_base.html +1 -0
  212. wagtail/admin/templates/wagtailadmin/generic/index.html +7 -2
  213. wagtail/admin/templates/wagtailadmin/pages/_editor_js.html +2 -3
  214. wagtail/admin/templates/wagtailadmin/pages/action_menu/publish.html +2 -2
  215. wagtail/admin/templates/wagtailadmin/pages/bulk_actions/confirm_bulk_move.html +0 -1
  216. wagtail/admin/templates/wagtailadmin/pages/move_choose_destination.html +0 -1
  217. wagtail/admin/templates/wagtailadmin/panels/publishing/schedule_publishing_panel.html +1 -1
  218. wagtail/admin/templates/wagtailadmin/shared/active_filters.html +8 -1
  219. wagtail/admin/templates/wagtailadmin/shared/pagination_nav.html +25 -13
  220. wagtail/admin/templates/wagtailadmin/shared/side_panels/includes/status/privacy.html +1 -2
  221. wagtail/admin/templates/wagtailadmin/shared/side_panels/includes/status/workflow.html +1 -1
  222. wagtail/admin/templates/wagtailadmin/skeleton.html +2 -1
  223. wagtail/admin/templates/wagtailadmin/tables/locale_cell.html +4 -0
  224. wagtail/admin/templates/wagtailadmin/userbar/base.html +10 -8
  225. wagtail/admin/templatetags/wagtailadmin_tags.py +57 -132
  226. wagtail/admin/tests/pages/test_bulk_actions/test_bulk_move.py +31 -0
  227. wagtail/admin/tests/pages/test_create_page.py +627 -0
  228. wagtail/admin/tests/pages/test_edit_page.py +102 -18
  229. wagtail/admin/tests/pages/test_explorer_view.py +55 -26
  230. wagtail/admin/tests/pages/test_page_search.py +10 -0
  231. wagtail/admin/tests/pages/test_page_usage.py +2 -1
  232. wagtail/admin/tests/pages/test_preview.py +176 -36
  233. wagtail/admin/tests/pages/test_revisions.py +4 -7
  234. wagtail/admin/tests/test_account_management.py +1 -1
  235. wagtail/admin/tests/test_admin_search.py +1 -0
  236. wagtail/admin/tests/test_buttons_hooks.py +9 -145
  237. wagtail/admin/tests/test_collections_views.py +60 -0
  238. wagtail/admin/tests/test_contentstate.py +1 -1
  239. wagtail/admin/tests/test_dashboard.py +25 -0
  240. wagtail/admin/tests/test_edit_handlers.py +64 -0
  241. wagtail/admin/tests/test_forms.py +38 -0
  242. wagtail/admin/tests/test_keyboard_shortcuts.py +141 -5
  243. wagtail/admin/tests/test_page_chooser.py +2 -2
  244. wagtail/admin/tests/test_paginator.py +86 -0
  245. wagtail/admin/tests/test_privacy.py +12 -1
  246. wagtail/admin/tests/test_reports_views.py +8 -43
  247. wagtail/admin/tests/test_rich_text.py +14 -0
  248. wagtail/admin/tests/test_templatetags.py +50 -36
  249. wagtail/admin/tests/test_userbar.py +79 -15
  250. wagtail/admin/tests/test_views.py +16 -1
  251. wagtail/admin/tests/test_widgets.py +47 -8
  252. wagtail/admin/tests/test_workflows.py +119 -6
  253. wagtail/admin/tests/tests.py +16 -15
  254. wagtail/admin/tests/ui/test_sidebar.py +0 -27
  255. wagtail/admin/tests/viewsets/test_chooser_viewset.py +38 -4
  256. wagtail/admin/tests/viewsets/test_model_viewset.py +1 -37
  257. wagtail/admin/ui/side_panels.py +14 -16
  258. wagtail/admin/ui/sidebar.py +5 -37
  259. wagtail/admin/ui/tables/__init__.py +34 -2
  260. wagtail/admin/ui/tables/pages.py +9 -0
  261. wagtail/admin/urls/__init__.py +2 -2
  262. wagtail/admin/urls/pages.py +3 -1
  263. wagtail/admin/userbar.py +3 -5
  264. wagtail/admin/utils.py +43 -4
  265. wagtail/admin/views/generic/base.py +16 -115
  266. wagtail/admin/views/generic/chooser.py +25 -8
  267. wagtail/admin/views/generic/mixins.py +45 -11
  268. wagtail/admin/views/generic/models.py +15 -30
  269. wagtail/admin/views/generic/preview.py +9 -3
  270. wagtail/admin/views/generic/workflow.py +11 -1
  271. wagtail/admin/views/i18n.py +14 -0
  272. wagtail/admin/views/pages/bulk_actions/move.py +1 -1
  273. wagtail/admin/views/pages/create.py +68 -6
  274. wagtail/admin/views/pages/edit.py +33 -14
  275. wagtail/admin/views/pages/listing.py +3 -2
  276. wagtail/admin/views/pages/move.py +43 -29
  277. wagtail/admin/views/pages/preview.py +15 -2
  278. wagtail/admin/views/pages/search.py +3 -0
  279. wagtail/admin/views/reports/base.py +0 -22
  280. wagtail/admin/views/reports/page_types_usage.py +2 -1
  281. wagtail/admin/views/tags.py +3 -1
  282. wagtail/admin/views/workflows.py +0 -3
  283. wagtail/admin/viewsets/model.py +5 -48
  284. wagtail/admin/wagtail_hooks.py +16 -17
  285. wagtail/admin/widgets/button.py +3 -33
  286. wagtail/admin/widgets/tags.py +31 -3
  287. wagtail/api/v2/views.py +4 -4
  288. wagtail/blocks/base.py +18 -15
  289. wagtail/blocks/field_block.py +2 -1
  290. wagtail/blocks/stream_block.py +15 -11
  291. wagtail/compat.py +17 -1
  292. wagtail/contrib/forms/forms.py +10 -7
  293. wagtail/contrib/forms/locale/af/LC_MESSAGES/django.po +1 -1
  294. wagtail/contrib/forms/locale/ar/LC_MESSAGES/django.po +1 -1
  295. wagtail/contrib/forms/locale/az_AZ/LC_MESSAGES/django.po +1 -1
  296. wagtail/contrib/forms/locale/be/LC_MESSAGES/django.po +1 -1
  297. wagtail/contrib/forms/locale/bg/LC_MESSAGES/django.po +1 -1
  298. wagtail/contrib/forms/locale/bn/LC_MESSAGES/django.po +1 -1
  299. wagtail/contrib/forms/locale/ca/LC_MESSAGES/django.po +1 -1
  300. wagtail/contrib/forms/locale/cs/LC_MESSAGES/django.mo +0 -0
  301. wagtail/contrib/forms/locale/cs/LC_MESSAGES/django.po +2 -2
  302. wagtail/contrib/forms/locale/cy/LC_MESSAGES/django.po +2 -1
  303. wagtail/contrib/forms/locale/da/LC_MESSAGES/django.po +1 -1
  304. wagtail/contrib/forms/locale/de/LC_MESSAGES/django.mo +0 -0
  305. wagtail/contrib/forms/locale/de/LC_MESSAGES/django.po +3 -2
  306. wagtail/contrib/forms/locale/dv/LC_MESSAGES/django.po +2 -1
  307. wagtail/contrib/forms/locale/el/LC_MESSAGES/django.po +1 -1
  308. wagtail/contrib/forms/locale/en/LC_MESSAGES/django.po +4 -4
  309. wagtail/contrib/forms/locale/es/LC_MESSAGES/django.po +1 -1
  310. wagtail/contrib/forms/locale/es_419/LC_MESSAGES/django.po +1 -1
  311. wagtail/contrib/forms/locale/et/LC_MESSAGES/django.po +1 -1
  312. wagtail/contrib/forms/locale/eu/LC_MESSAGES/django.po +1 -1
  313. wagtail/contrib/forms/locale/fa/LC_MESSAGES/django.po +1 -1
  314. wagtail/contrib/forms/locale/fi/LC_MESSAGES/django.po +1 -1
  315. wagtail/contrib/forms/locale/fr/LC_MESSAGES/django.po +2 -1
  316. wagtail/contrib/forms/locale/gl/LC_MESSAGES/django.po +1 -1
  317. wagtail/contrib/forms/locale/he_IL/LC_MESSAGES/django.po +1 -1
  318. wagtail/contrib/forms/locale/hr_HR/LC_MESSAGES/django.po +1 -1
  319. wagtail/contrib/forms/locale/ht/LC_MESSAGES/django.po +1 -1
  320. wagtail/contrib/forms/locale/hu/LC_MESSAGES/django.po +1 -1
  321. wagtail/contrib/forms/locale/hy/LC_MESSAGES/django.po +1 -1
  322. wagtail/contrib/forms/locale/id_ID/LC_MESSAGES/django.po +1 -1
  323. wagtail/contrib/forms/locale/is_IS/LC_MESSAGES/django.po +1 -1
  324. wagtail/contrib/forms/locale/it/LC_MESSAGES/django.po +1 -1
  325. wagtail/contrib/forms/locale/ja/LC_MESSAGES/django.po +1 -1
  326. wagtail/contrib/forms/locale/ka/LC_MESSAGES/django.po +1 -1
  327. wagtail/contrib/forms/locale/ko/LC_MESSAGES/django.po +1 -1
  328. wagtail/contrib/forms/locale/lt/LC_MESSAGES/django.po +1 -1
  329. wagtail/contrib/forms/locale/lv/LC_MESSAGES/django.po +1 -1
  330. wagtail/contrib/forms/locale/mi/LC_MESSAGES/django.po +1 -1
  331. wagtail/contrib/forms/locale/mn/LC_MESSAGES/django.mo +0 -0
  332. wagtail/contrib/forms/locale/mn/LC_MESSAGES/django.po +3 -2
  333. wagtail/contrib/forms/locale/my/LC_MESSAGES/django.po +1 -1
  334. wagtail/contrib/forms/locale/nb/LC_MESSAGES/django.po +1 -1
  335. wagtail/contrib/forms/locale/nl/LC_MESSAGES/django.mo +0 -0
  336. wagtail/contrib/forms/locale/nl/LC_MESSAGES/django.po +2 -2
  337. wagtail/contrib/forms/locale/pl/LC_MESSAGES/django.mo +0 -0
  338. wagtail/contrib/forms/locale/pl/LC_MESSAGES/django.po +2 -2
  339. wagtail/contrib/forms/locale/pt_BR/LC_MESSAGES/django.po +2 -1
  340. wagtail/contrib/forms/locale/pt_PT/LC_MESSAGES/django.po +1 -1
  341. wagtail/contrib/forms/locale/ro/LC_MESSAGES/django.mo +0 -0
  342. wagtail/contrib/forms/locale/ro/LC_MESSAGES/django.po +2 -2
  343. wagtail/contrib/forms/locale/ru/LC_MESSAGES/django.po +2 -1
  344. wagtail/contrib/forms/locale/sk_SK/LC_MESSAGES/django.po +1 -1
  345. wagtail/contrib/forms/locale/sl/LC_MESSAGES/django.mo +0 -0
  346. wagtail/contrib/forms/locale/sl/LC_MESSAGES/django.po +2 -2
  347. wagtail/contrib/forms/locale/sv/LC_MESSAGES/django.po +1 -1
  348. wagtail/contrib/forms/locale/tet/LC_MESSAGES/django.po +1 -1
  349. wagtail/contrib/forms/locale/th/LC_MESSAGES/django.po +1 -1
  350. wagtail/contrib/forms/locale/tr/LC_MESSAGES/django.po +1 -1
  351. wagtail/contrib/forms/locale/tr_TR/LC_MESSAGES/django.po +1 -1
  352. wagtail/contrib/forms/locale/ug/LC_MESSAGES/django.po +1 -1
  353. wagtail/contrib/forms/locale/uk/LC_MESSAGES/django.po +1 -1
  354. wagtail/contrib/forms/locale/vi/LC_MESSAGES/django.po +1 -1
  355. wagtail/contrib/forms/locale/zh/LC_MESSAGES/django.po +1 -1
  356. wagtail/contrib/forms/locale/zh_Hans/LC_MESSAGES/django.mo +0 -0
  357. wagtail/contrib/forms/locale/zh_Hans/LC_MESSAGES/django.po +2 -2
  358. wagtail/contrib/forms/locale/zh_Hant/LC_MESSAGES/django.po +1 -1
  359. wagtail/contrib/forms/tests/test_forms.py +62 -0
  360. wagtail/contrib/frontend_cache/backends/cloudfront.py +1 -29
  361. wagtail/contrib/frontend_cache/tests.py +112 -52
  362. wagtail/contrib/frontend_cache/utils.py +109 -17
  363. wagtail/contrib/redirects/forms.py +3 -2
  364. wagtail/contrib/redirects/locale/ar/LC_MESSAGES/django.po +1 -1
  365. wagtail/contrib/redirects/locale/be/LC_MESSAGES/django.po +1 -1
  366. wagtail/contrib/redirects/locale/bg/LC_MESSAGES/django.po +1 -1
  367. wagtail/contrib/redirects/locale/bn/LC_MESSAGES/django.po +1 -1
  368. wagtail/contrib/redirects/locale/ca/LC_MESSAGES/django.mo +0 -0
  369. wagtail/contrib/redirects/locale/ca/LC_MESSAGES/django.po +2 -2
  370. wagtail/contrib/redirects/locale/cs/LC_MESSAGES/django.po +1 -1
  371. wagtail/contrib/redirects/locale/cy/LC_MESSAGES/django.po +2 -1
  372. wagtail/contrib/redirects/locale/da/LC_MESSAGES/django.po +1 -1
  373. wagtail/contrib/redirects/locale/de/LC_MESSAGES/django.po +2 -1
  374. wagtail/contrib/redirects/locale/dv/LC_MESSAGES/django.po +2 -1
  375. wagtail/contrib/redirects/locale/el/LC_MESSAGES/django.po +1 -1
  376. wagtail/contrib/redirects/locale/en/LC_MESSAGES/django.po +8 -8
  377. wagtail/contrib/redirects/locale/en_IN/LC_MESSAGES/django.po +1 -1
  378. wagtail/contrib/redirects/locale/es/LC_MESSAGES/django.po +1 -1
  379. wagtail/contrib/redirects/locale/es_419/LC_MESSAGES/django.po +1 -1
  380. wagtail/contrib/redirects/locale/es_VE/LC_MESSAGES/django.po +1 -1
  381. wagtail/contrib/redirects/locale/et/LC_MESSAGES/django.po +1 -1
  382. wagtail/contrib/redirects/locale/eu/LC_MESSAGES/django.po +1 -1
  383. wagtail/contrib/redirects/locale/fa/LC_MESSAGES/django.mo +0 -0
  384. wagtail/contrib/redirects/locale/fa/LC_MESSAGES/django.po +3 -2
  385. wagtail/contrib/redirects/locale/fi/LC_MESSAGES/django.mo +0 -0
  386. wagtail/contrib/redirects/locale/fi/LC_MESSAGES/django.po +2 -2
  387. wagtail/contrib/redirects/locale/fr/LC_MESSAGES/django.po +3 -1
  388. wagtail/contrib/redirects/locale/gl/LC_MESSAGES/django.po +1 -1
  389. wagtail/contrib/redirects/locale/he_IL/LC_MESSAGES/django.po +1 -1
  390. wagtail/contrib/redirects/locale/hi/LC_MESSAGES/django.po +1 -1
  391. wagtail/contrib/redirects/locale/hr_HR/LC_MESSAGES/django.po +1 -1
  392. wagtail/contrib/redirects/locale/ht/LC_MESSAGES/django.po +1 -1
  393. wagtail/contrib/redirects/locale/hu/LC_MESSAGES/django.po +1 -1
  394. wagtail/contrib/redirects/locale/hy/LC_MESSAGES/django.po +1 -1
  395. wagtail/contrib/redirects/locale/id_ID/LC_MESSAGES/django.po +1 -1
  396. wagtail/contrib/redirects/locale/is_IS/LC_MESSAGES/django.po +1 -1
  397. wagtail/contrib/redirects/locale/it/LC_MESSAGES/django.po +1 -1
  398. wagtail/contrib/redirects/locale/ja/LC_MESSAGES/django.po +1 -1
  399. wagtail/contrib/redirects/locale/ka/LC_MESSAGES/django.po +1 -1
  400. wagtail/contrib/redirects/locale/ko/LC_MESSAGES/django.mo +0 -0
  401. wagtail/contrib/redirects/locale/ko/LC_MESSAGES/django.po +18 -2
  402. wagtail/contrib/redirects/locale/lt/LC_MESSAGES/django.po +1 -1
  403. wagtail/contrib/redirects/locale/lv/LC_MESSAGES/django.po +1 -1
  404. wagtail/contrib/redirects/locale/mi/LC_MESSAGES/django.po +1 -1
  405. wagtail/contrib/redirects/locale/mn/LC_MESSAGES/django.po +1 -1
  406. wagtail/contrib/redirects/locale/my/LC_MESSAGES/django.po +1 -1
  407. wagtail/contrib/redirects/locale/nb/LC_MESSAGES/django.po +2 -1
  408. wagtail/contrib/redirects/locale/nl/LC_MESSAGES/django.mo +0 -0
  409. wagtail/contrib/redirects/locale/nl/LC_MESSAGES/django.po +2 -2
  410. wagtail/contrib/redirects/locale/pl/LC_MESSAGES/django.mo +0 -0
  411. wagtail/contrib/redirects/locale/pl/LC_MESSAGES/django.po +2 -2
  412. wagtail/contrib/redirects/locale/pt_BR/LC_MESSAGES/django.mo +0 -0
  413. wagtail/contrib/redirects/locale/pt_BR/LC_MESSAGES/django.po +3 -2
  414. wagtail/contrib/redirects/locale/pt_PT/LC_MESSAGES/django.po +1 -1
  415. wagtail/contrib/redirects/locale/ro/LC_MESSAGES/django.mo +0 -0
  416. wagtail/contrib/redirects/locale/ro/LC_MESSAGES/django.po +3 -2
  417. wagtail/contrib/redirects/locale/ru/LC_MESSAGES/django.mo +0 -0
  418. wagtail/contrib/redirects/locale/ru/LC_MESSAGES/django.po +3 -2
  419. wagtail/contrib/redirects/locale/sk_SK/LC_MESSAGES/django.po +1 -1
  420. wagtail/contrib/redirects/locale/sl/LC_MESSAGES/django.mo +0 -0
  421. wagtail/contrib/redirects/locale/sl/LC_MESSAGES/django.po +2 -2
  422. wagtail/contrib/redirects/locale/sr/LC_MESSAGES/django.po +1 -1
  423. wagtail/contrib/redirects/locale/sv/LC_MESSAGES/django.mo +0 -0
  424. wagtail/contrib/redirects/locale/sv/LC_MESSAGES/django.po +2 -2
  425. wagtail/contrib/redirects/locale/ta/LC_MESSAGES/django.po +1 -1
  426. wagtail/contrib/redirects/locale/tet/LC_MESSAGES/django.po +1 -1
  427. wagtail/contrib/redirects/locale/th/LC_MESSAGES/django.po +1 -1
  428. wagtail/contrib/redirects/locale/tr/LC_MESSAGES/django.po +1 -1
  429. wagtail/contrib/redirects/locale/tr_TR/LC_MESSAGES/django.po +1 -1
  430. wagtail/contrib/redirects/locale/ug/LC_MESSAGES/django.po +1 -1
  431. wagtail/contrib/redirects/locale/uk/LC_MESSAGES/django.mo +0 -0
  432. wagtail/contrib/redirects/locale/uk/LC_MESSAGES/django.po +3 -2
  433. wagtail/contrib/redirects/locale/vi/LC_MESSAGES/django.po +1 -1
  434. wagtail/contrib/redirects/locale/zh/LC_MESSAGES/django.po +1 -1
  435. wagtail/contrib/redirects/locale/zh_Hans/LC_MESSAGES/django.mo +0 -0
  436. wagtail/contrib/redirects/locale/zh_Hans/LC_MESSAGES/django.po +2 -2
  437. wagtail/contrib/redirects/locale/zh_Hant/LC_MESSAGES/django.po +1 -1
  438. wagtail/contrib/redirects/tmp_storages.py +1 -0
  439. wagtail/contrib/routable_page/tests.py +3 -3
  440. wagtail/contrib/search_promotions/forms.py +3 -2
  441. wagtail/contrib/search_promotions/locale/af/LC_MESSAGES/django.po +1 -1
  442. wagtail/contrib/search_promotions/locale/ar/LC_MESSAGES/django.mo +0 -0
  443. wagtail/contrib/search_promotions/locale/ar/LC_MESSAGES/django.po +1 -4
  444. wagtail/contrib/search_promotions/locale/az_AZ/LC_MESSAGES/django.po +1 -1
  445. wagtail/contrib/search_promotions/locale/be/LC_MESSAGES/django.mo +0 -0
  446. wagtail/contrib/search_promotions/locale/be/LC_MESSAGES/django.po +1 -4
  447. wagtail/contrib/search_promotions/locale/bg/LC_MESSAGES/django.mo +0 -0
  448. wagtail/contrib/search_promotions/locale/bg/LC_MESSAGES/django.po +1 -4
  449. wagtail/contrib/search_promotions/locale/bn/LC_MESSAGES/django.po +1 -1
  450. wagtail/contrib/search_promotions/locale/ca/LC_MESSAGES/django.mo +0 -0
  451. wagtail/contrib/search_promotions/locale/ca/LC_MESSAGES/django.po +3 -6
  452. wagtail/contrib/search_promotions/locale/cs/LC_MESSAGES/django.mo +0 -0
  453. wagtail/contrib/search_promotions/locale/cs/LC_MESSAGES/django.po +1 -4
  454. wagtail/contrib/search_promotions/locale/cy/LC_MESSAGES/django.mo +0 -0
  455. wagtail/contrib/search_promotions/locale/cy/LC_MESSAGES/django.po +1 -4
  456. wagtail/contrib/search_promotions/locale/da/LC_MESSAGES/django.po +1 -1
  457. wagtail/contrib/search_promotions/locale/de/LC_MESSAGES/django.mo +0 -0
  458. wagtail/contrib/search_promotions/locale/de/LC_MESSAGES/django.po +3 -6
  459. wagtail/contrib/search_promotions/locale/dv/LC_MESSAGES/django.po +2 -1
  460. wagtail/contrib/search_promotions/locale/el/LC_MESSAGES/django.mo +0 -0
  461. wagtail/contrib/search_promotions/locale/el/LC_MESSAGES/django.po +1 -4
  462. wagtail/contrib/search_promotions/locale/en/LC_MESSAGES/django.po +19 -23
  463. wagtail/contrib/search_promotions/locale/es/LC_MESSAGES/django.mo +0 -0
  464. wagtail/contrib/search_promotions/locale/es/LC_MESSAGES/django.po +1 -4
  465. wagtail/contrib/search_promotions/locale/es_419/LC_MESSAGES/django.po +1 -1
  466. wagtail/contrib/search_promotions/locale/et/LC_MESSAGES/django.mo +0 -0
  467. wagtail/contrib/search_promotions/locale/et/LC_MESSAGES/django.po +1 -4
  468. wagtail/contrib/search_promotions/locale/eu/LC_MESSAGES/django.po +1 -1
  469. wagtail/contrib/search_promotions/locale/fa/LC_MESSAGES/django.mo +0 -0
  470. wagtail/contrib/search_promotions/locale/fa/LC_MESSAGES/django.po +1 -4
  471. wagtail/contrib/search_promotions/locale/fi/LC_MESSAGES/django.mo +0 -0
  472. wagtail/contrib/search_promotions/locale/fi/LC_MESSAGES/django.po +1 -4
  473. wagtail/contrib/search_promotions/locale/fr/LC_MESSAGES/django.mo +0 -0
  474. wagtail/contrib/search_promotions/locale/fr/LC_MESSAGES/django.po +3 -6
  475. wagtail/contrib/search_promotions/locale/gl/LC_MESSAGES/django.mo +0 -0
  476. wagtail/contrib/search_promotions/locale/gl/LC_MESSAGES/django.po +3 -6
  477. wagtail/contrib/search_promotions/locale/he_IL/LC_MESSAGES/django.po +1 -1
  478. wagtail/contrib/search_promotions/locale/hr_HR/LC_MESSAGES/django.mo +0 -0
  479. wagtail/contrib/search_promotions/locale/hr_HR/LC_MESSAGES/django.po +1 -4
  480. wagtail/contrib/search_promotions/locale/ht/LC_MESSAGES/django.mo +0 -0
  481. wagtail/contrib/search_promotions/locale/ht/LC_MESSAGES/django.po +1 -4
  482. wagtail/contrib/search_promotions/locale/hu/LC_MESSAGES/django.mo +0 -0
  483. wagtail/contrib/search_promotions/locale/hu/LC_MESSAGES/django.po +11 -5
  484. wagtail/contrib/search_promotions/locale/id_ID/LC_MESSAGES/django.mo +0 -0
  485. wagtail/contrib/search_promotions/locale/id_ID/LC_MESSAGES/django.po +1 -4
  486. wagtail/contrib/search_promotions/locale/is_IS/LC_MESSAGES/django.mo +0 -0
  487. wagtail/contrib/search_promotions/locale/is_IS/LC_MESSAGES/django.po +1 -4
  488. wagtail/contrib/search_promotions/locale/it/LC_MESSAGES/django.mo +0 -0
  489. wagtail/contrib/search_promotions/locale/it/LC_MESSAGES/django.po +1 -4
  490. wagtail/contrib/search_promotions/locale/ja/LC_MESSAGES/django.mo +0 -0
  491. wagtail/contrib/search_promotions/locale/ja/LC_MESSAGES/django.po +1 -4
  492. wagtail/contrib/search_promotions/locale/ka/LC_MESSAGES/django.po +1 -1
  493. wagtail/contrib/search_promotions/locale/ko/LC_MESSAGES/django.mo +0 -0
  494. wagtail/contrib/search_promotions/locale/ko/LC_MESSAGES/django.po +5 -4
  495. wagtail/contrib/search_promotions/locale/lt/LC_MESSAGES/django.mo +0 -0
  496. wagtail/contrib/search_promotions/locale/lt/LC_MESSAGES/django.po +1 -4
  497. wagtail/contrib/search_promotions/locale/lv/LC_MESSAGES/django.mo +0 -0
  498. wagtail/contrib/search_promotions/locale/lv/LC_MESSAGES/django.po +1 -4
  499. wagtail/contrib/search_promotions/locale/mi/LC_MESSAGES/django.mo +0 -0
  500. wagtail/contrib/search_promotions/locale/mi/LC_MESSAGES/django.po +1 -4
  501. wagtail/contrib/search_promotions/locale/mn/LC_MESSAGES/django.mo +0 -0
  502. wagtail/contrib/search_promotions/locale/mn/LC_MESSAGES/django.po +1 -4
  503. wagtail/contrib/search_promotions/locale/my/LC_MESSAGES/django.mo +0 -0
  504. wagtail/contrib/search_promotions/locale/my/LC_MESSAGES/django.po +1 -4
  505. wagtail/contrib/search_promotions/locale/nb/LC_MESSAGES/django.mo +0 -0
  506. wagtail/contrib/search_promotions/locale/nb/LC_MESSAGES/django.po +1 -4
  507. wagtail/contrib/search_promotions/locale/nl/LC_MESSAGES/django.mo +0 -0
  508. wagtail/contrib/search_promotions/locale/nl/LC_MESSAGES/django.po +3 -6
  509. wagtail/contrib/search_promotions/locale/pl/LC_MESSAGES/django.mo +0 -0
  510. wagtail/contrib/search_promotions/locale/pl/LC_MESSAGES/django.po +1 -4
  511. wagtail/contrib/search_promotions/locale/pt_BR/LC_MESSAGES/django.mo +0 -0
  512. wagtail/contrib/search_promotions/locale/pt_BR/LC_MESSAGES/django.po +1 -4
  513. wagtail/contrib/search_promotions/locale/pt_PT/LC_MESSAGES/django.mo +0 -0
  514. wagtail/contrib/search_promotions/locale/pt_PT/LC_MESSAGES/django.po +1 -4
  515. wagtail/contrib/search_promotions/locale/ro/LC_MESSAGES/django.mo +0 -0
  516. wagtail/contrib/search_promotions/locale/ro/LC_MESSAGES/django.po +1 -4
  517. wagtail/contrib/search_promotions/locale/ru/LC_MESSAGES/django.mo +0 -0
  518. wagtail/contrib/search_promotions/locale/ru/LC_MESSAGES/django.po +3 -6
  519. wagtail/contrib/search_promotions/locale/sk_SK/LC_MESSAGES/django.mo +0 -0
  520. wagtail/contrib/search_promotions/locale/sk_SK/LC_MESSAGES/django.po +1 -4
  521. wagtail/contrib/search_promotions/locale/sl/LC_MESSAGES/django.mo +0 -0
  522. wagtail/contrib/search_promotions/locale/sl/LC_MESSAGES/django.po +1 -4
  523. wagtail/contrib/search_promotions/locale/sv/LC_MESSAGES/django.mo +0 -0
  524. wagtail/contrib/search_promotions/locale/sv/LC_MESSAGES/django.po +1 -4
  525. wagtail/contrib/search_promotions/locale/tet/LC_MESSAGES/django.mo +0 -0
  526. wagtail/contrib/search_promotions/locale/tet/LC_MESSAGES/django.po +1 -4
  527. wagtail/contrib/search_promotions/locale/th/LC_MESSAGES/django.mo +0 -0
  528. wagtail/contrib/search_promotions/locale/th/LC_MESSAGES/django.po +1 -4
  529. wagtail/contrib/search_promotions/locale/tr/LC_MESSAGES/django.mo +0 -0
  530. wagtail/contrib/search_promotions/locale/tr/LC_MESSAGES/django.po +1 -4
  531. wagtail/contrib/search_promotions/locale/tr_TR/LC_MESSAGES/django.mo +0 -0
  532. wagtail/contrib/search_promotions/locale/tr_TR/LC_MESSAGES/django.po +1 -4
  533. wagtail/contrib/search_promotions/locale/ug/LC_MESSAGES/django.mo +0 -0
  534. wagtail/contrib/search_promotions/locale/ug/LC_MESSAGES/django.po +1 -4
  535. wagtail/contrib/search_promotions/locale/uk/LC_MESSAGES/django.mo +0 -0
  536. wagtail/contrib/search_promotions/locale/uk/LC_MESSAGES/django.po +1 -4
  537. wagtail/contrib/search_promotions/locale/vi/LC_MESSAGES/django.mo +0 -0
  538. wagtail/contrib/search_promotions/locale/vi/LC_MESSAGES/django.po +1 -4
  539. wagtail/contrib/search_promotions/locale/zh/LC_MESSAGES/django.mo +0 -0
  540. wagtail/contrib/search_promotions/locale/zh/LC_MESSAGES/django.po +1 -4
  541. wagtail/contrib/search_promotions/locale/zh_Hans/LC_MESSAGES/django.mo +0 -0
  542. wagtail/contrib/search_promotions/locale/zh_Hans/LC_MESSAGES/django.po +1 -4
  543. wagtail/contrib/search_promotions/locale/zh_Hant/LC_MESSAGES/django.mo +0 -0
  544. wagtail/contrib/search_promotions/locale/zh_Hant/LC_MESSAGES/django.po +1 -4
  545. wagtail/contrib/search_promotions/models.py +1 -7
  546. wagtail/contrib/search_promotions/templates/wagtailsearchpromotions/queries/chooser/results.html +1 -1
  547. wagtail/contrib/search_promotions/tests.py +4 -5
  548. wagtail/contrib/search_promotions/views/settings.py +1 -2
  549. wagtail/contrib/settings/locale/en/LC_MESSAGES/django.po +1 -1
  550. wagtail/contrib/settings/registry.py +1 -11
  551. wagtail/contrib/simple_translation/locale/en/LC_MESSAGES/django.po +1 -1
  552. wagtail/contrib/simple_translation/locale/hu/LC_MESSAGES/django.mo +0 -0
  553. wagtail/contrib/simple_translation/locale/hu/LC_MESSAGES/django.po +5 -2
  554. wagtail/contrib/styleguide/locale/af/LC_MESSAGES/django.po +1 -1
  555. wagtail/contrib/styleguide/locale/ar/LC_MESSAGES/django.po +1 -1
  556. wagtail/contrib/styleguide/locale/az_AZ/LC_MESSAGES/django.po +1 -1
  557. wagtail/contrib/styleguide/locale/be/LC_MESSAGES/django.mo +0 -0
  558. wagtail/contrib/styleguide/locale/be/LC_MESSAGES/django.po +3 -2
  559. wagtail/contrib/styleguide/locale/bg/LC_MESSAGES/django.po +1 -1
  560. wagtail/contrib/styleguide/locale/bn/LC_MESSAGES/django.po +1 -1
  561. wagtail/contrib/styleguide/locale/ca/LC_MESSAGES/django.po +1 -1
  562. wagtail/contrib/styleguide/locale/cs/LC_MESSAGES/django.po +1 -1
  563. wagtail/contrib/styleguide/locale/cy/LC_MESSAGES/django.po +2 -1
  564. wagtail/contrib/styleguide/locale/da/LC_MESSAGES/django.po +1 -1
  565. wagtail/contrib/styleguide/locale/de/LC_MESSAGES/django.po +1 -1
  566. wagtail/contrib/styleguide/locale/dv/LC_MESSAGES/django.po +2 -1
  567. wagtail/contrib/styleguide/locale/el/LC_MESSAGES/django.po +2 -1
  568. wagtail/contrib/styleguide/locale/en/LC_MESSAGES/django.po +7 -7
  569. wagtail/contrib/styleguide/locale/en_IN/LC_MESSAGES/django.po +1 -1
  570. wagtail/contrib/styleguide/locale/es/LC_MESSAGES/django.po +1 -1
  571. wagtail/contrib/styleguide/locale/es_419/LC_MESSAGES/django.po +1 -1
  572. wagtail/contrib/styleguide/locale/es_VE/LC_MESSAGES/django.po +1 -1
  573. wagtail/contrib/styleguide/locale/et/LC_MESSAGES/django.po +1 -1
  574. wagtail/contrib/styleguide/locale/fa/LC_MESSAGES/django.po +1 -1
  575. wagtail/contrib/styleguide/locale/fi/LC_MESSAGES/django.po +1 -1
  576. wagtail/contrib/styleguide/locale/fr/LC_MESSAGES/django.po +1 -1
  577. wagtail/contrib/styleguide/locale/gl/LC_MESSAGES/django.po +1 -1
  578. wagtail/contrib/styleguide/locale/he_IL/LC_MESSAGES/django.po +1 -1
  579. wagtail/contrib/styleguide/locale/hi/LC_MESSAGES/django.po +1 -1
  580. wagtail/contrib/styleguide/locale/hr_HR/LC_MESSAGES/django.po +1 -1
  581. wagtail/contrib/styleguide/locale/ht/LC_MESSAGES/django.po +1 -1
  582. wagtail/contrib/styleguide/locale/hu/LC_MESSAGES/django.po +1 -1
  583. wagtail/contrib/styleguide/locale/id_ID/LC_MESSAGES/django.po +1 -1
  584. wagtail/contrib/styleguide/locale/is_IS/LC_MESSAGES/django.po +1 -1
  585. wagtail/contrib/styleguide/locale/it/LC_MESSAGES/django.po +1 -1
  586. wagtail/contrib/styleguide/locale/ja/LC_MESSAGES/django.po +1 -1
  587. wagtail/contrib/styleguide/locale/ka/LC_MESSAGES/django.po +1 -1
  588. wagtail/contrib/styleguide/locale/ko/LC_MESSAGES/django.po +1 -1
  589. wagtail/contrib/styleguide/locale/lt/LC_MESSAGES/django.po +1 -1
  590. wagtail/contrib/styleguide/locale/lv/LC_MESSAGES/django.po +1 -1
  591. wagtail/contrib/styleguide/locale/mi/LC_MESSAGES/django.po +1 -1
  592. wagtail/contrib/styleguide/locale/mn/LC_MESSAGES/django.po +1 -1
  593. wagtail/contrib/styleguide/locale/my/LC_MESSAGES/django.po +1 -1
  594. wagtail/contrib/styleguide/locale/nb/LC_MESSAGES/django.po +1 -1
  595. wagtail/contrib/styleguide/locale/nl/LC_MESSAGES/django.po +1 -1
  596. wagtail/contrib/styleguide/locale/pl/LC_MESSAGES/django.po +1 -1
  597. wagtail/contrib/styleguide/locale/pt_BR/LC_MESSAGES/django.po +1 -1
  598. wagtail/contrib/styleguide/locale/pt_PT/LC_MESSAGES/django.po +1 -1
  599. wagtail/contrib/styleguide/locale/ro/LC_MESSAGES/django.po +1 -1
  600. wagtail/contrib/styleguide/locale/ru/LC_MESSAGES/django.po +1 -1
  601. wagtail/contrib/styleguide/locale/sk_SK/LC_MESSAGES/django.mo +0 -0
  602. wagtail/contrib/styleguide/locale/sk_SK/LC_MESSAGES/django.po +2 -2
  603. wagtail/contrib/styleguide/locale/sl/LC_MESSAGES/django.po +1 -1
  604. wagtail/contrib/styleguide/locale/sv/LC_MESSAGES/django.po +1 -1
  605. wagtail/contrib/styleguide/locale/ta/LC_MESSAGES/django.po +1 -1
  606. wagtail/contrib/styleguide/locale/tet/LC_MESSAGES/django.po +1 -1
  607. wagtail/contrib/styleguide/locale/th/LC_MESSAGES/django.po +1 -1
  608. wagtail/contrib/styleguide/locale/tr/LC_MESSAGES/django.po +1 -1
  609. wagtail/contrib/styleguide/locale/tr_TR/LC_MESSAGES/django.po +1 -1
  610. wagtail/contrib/styleguide/locale/ug/LC_MESSAGES/django.po +1 -1
  611. wagtail/contrib/styleguide/locale/uk/LC_MESSAGES/django.po +1 -1
  612. wagtail/contrib/styleguide/locale/vi/LC_MESSAGES/django.po +1 -1
  613. wagtail/contrib/styleguide/locale/zh/LC_MESSAGES/django.po +1 -1
  614. wagtail/contrib/styleguide/locale/zh_Hans/LC_MESSAGES/django.po +1 -1
  615. wagtail/contrib/styleguide/locale/zh_Hant/LC_MESSAGES/django.po +1 -1
  616. wagtail/contrib/styleguide/views.py +2 -1
  617. wagtail/contrib/table_block/locale/en/LC_MESSAGES/django.po +1 -1
  618. wagtail/contrib/typed_table_block/blocks.py +5 -0
  619. wagtail/contrib/typed_table_block/locale/ar/LC_MESSAGES/django.po +1 -1
  620. wagtail/contrib/typed_table_block/locale/be/LC_MESSAGES/django.po +1 -1
  621. wagtail/contrib/typed_table_block/locale/ca/LC_MESSAGES/django.po +1 -1
  622. wagtail/contrib/typed_table_block/locale/cy/LC_MESSAGES/django.po +1 -1
  623. wagtail/contrib/typed_table_block/locale/de/LC_MESSAGES/django.po +1 -1
  624. wagtail/contrib/typed_table_block/locale/dv/LC_MESSAGES/django.po +1 -1
  625. wagtail/contrib/typed_table_block/locale/el/LC_MESSAGES/django.po +1 -1
  626. wagtail/contrib/typed_table_block/locale/en/LC_MESSAGES/django.po +10 -10
  627. wagtail/contrib/typed_table_block/locale/es/LC_MESSAGES/django.po +1 -1
  628. wagtail/contrib/typed_table_block/locale/fa/LC_MESSAGES/django.po +1 -1
  629. wagtail/contrib/typed_table_block/locale/fi/LC_MESSAGES/django.po +1 -1
  630. wagtail/contrib/typed_table_block/locale/fr/LC_MESSAGES/django.po +1 -1
  631. wagtail/contrib/typed_table_block/locale/gl/LC_MESSAGES/django.po +1 -1
  632. wagtail/contrib/typed_table_block/locale/hu/LC_MESSAGES/django.po +1 -1
  633. wagtail/contrib/typed_table_block/locale/is_IS/LC_MESSAGES/django.po +1 -1
  634. wagtail/contrib/typed_table_block/locale/it/LC_MESSAGES/django.po +1 -1
  635. wagtail/contrib/typed_table_block/locale/ko/LC_MESSAGES/django.po +1 -1
  636. wagtail/contrib/typed_table_block/locale/lt/LC_MESSAGES/django.po +1 -1
  637. wagtail/contrib/typed_table_block/locale/nl/LC_MESSAGES/django.po +1 -1
  638. wagtail/contrib/typed_table_block/locale/pl/LC_MESSAGES/django.po +1 -1
  639. wagtail/contrib/typed_table_block/locale/pt_BR/LC_MESSAGES/django.po +1 -1
  640. wagtail/contrib/typed_table_block/locale/pt_PT/LC_MESSAGES/django.po +1 -1
  641. wagtail/contrib/typed_table_block/locale/ro/LC_MESSAGES/django.po +1 -1
  642. wagtail/contrib/typed_table_block/locale/ru/LC_MESSAGES/django.po +1 -1
  643. wagtail/contrib/typed_table_block/locale/sl/LC_MESSAGES/django.po +1 -1
  644. wagtail/contrib/typed_table_block/locale/sv/LC_MESSAGES/django.po +1 -1
  645. wagtail/contrib/typed_table_block/locale/th/LC_MESSAGES/django.po +1 -1
  646. wagtail/contrib/typed_table_block/locale/ug/LC_MESSAGES/django.po +1 -1
  647. wagtail/contrib/typed_table_block/locale/uk/LC_MESSAGES/django.po +1 -1
  648. wagtail/contrib/typed_table_block/locale/zh/LC_MESSAGES/django.po +1 -1
  649. wagtail/contrib/typed_table_block/locale/zh_Hans/LC_MESSAGES/django.po +1 -1
  650. wagtail/contrib/typed_table_block/locale/zh_Hant/LC_MESSAGES/django.po +1 -1
  651. wagtail/contrib/typed_table_block/tests.py +27 -0
  652. wagtail/coreutils.py +0 -19
  653. wagtail/documents/locale/af/LC_MESSAGES/django.po +1 -1
  654. wagtail/documents/locale/ar/LC_MESSAGES/django.mo +0 -0
  655. wagtail/documents/locale/ar/LC_MESSAGES/django.po +3 -2
  656. wagtail/documents/locale/az_AZ/LC_MESSAGES/django.po +1 -1
  657. wagtail/documents/locale/be/LC_MESSAGES/django.po +1 -1
  658. wagtail/documents/locale/bg/LC_MESSAGES/django.po +1 -1
  659. wagtail/documents/locale/bn/LC_MESSAGES/django.po +1 -1
  660. wagtail/documents/locale/ca/LC_MESSAGES/django.mo +0 -0
  661. wagtail/documents/locale/ca/LC_MESSAGES/django.po +2 -2
  662. wagtail/documents/locale/cs/LC_MESSAGES/django.po +1 -1
  663. wagtail/documents/locale/cy/LC_MESSAGES/django.po +1 -1
  664. wagtail/documents/locale/da/LC_MESSAGES/django.po +1 -1
  665. wagtail/documents/locale/de/LC_MESSAGES/django.mo +0 -0
  666. wagtail/documents/locale/de/LC_MESSAGES/django.po +3 -3
  667. wagtail/documents/locale/dv/LC_MESSAGES/django.po +2 -1
  668. wagtail/documents/locale/el/LC_MESSAGES/django.po +2 -1
  669. wagtail/documents/locale/en/LC_MESSAGES/django.po +4 -4
  670. wagtail/documents/locale/es/LC_MESSAGES/django.mo +0 -0
  671. wagtail/documents/locale/es/LC_MESSAGES/django.po +3 -2
  672. wagtail/documents/locale/es_419/LC_MESSAGES/django.po +1 -1
  673. wagtail/documents/locale/et/LC_MESSAGES/django.po +1 -1
  674. wagtail/documents/locale/eu/LC_MESSAGES/django.po +1 -1
  675. wagtail/documents/locale/fa/LC_MESSAGES/django.po +1 -1
  676. wagtail/documents/locale/fi/LC_MESSAGES/django.mo +0 -0
  677. wagtail/documents/locale/fi/LC_MESSAGES/django.po +2 -2
  678. wagtail/documents/locale/fr/LC_MESSAGES/django.po +2 -1
  679. wagtail/documents/locale/gl/LC_MESSAGES/django.po +1 -1
  680. wagtail/documents/locale/he_IL/LC_MESSAGES/django.po +1 -1
  681. wagtail/documents/locale/hr_HR/LC_MESSAGES/django.po +1 -1
  682. wagtail/documents/locale/ht/LC_MESSAGES/django.po +1 -1
  683. wagtail/documents/locale/hu/LC_MESSAGES/django.mo +0 -0
  684. wagtail/documents/locale/hu/LC_MESSAGES/django.po +18 -3
  685. wagtail/documents/locale/id_ID/LC_MESSAGES/django.po +1 -1
  686. wagtail/documents/locale/is_IS/LC_MESSAGES/django.po +1 -1
  687. wagtail/documents/locale/it/LC_MESSAGES/django.mo +0 -0
  688. wagtail/documents/locale/it/LC_MESSAGES/django.po +2 -2
  689. wagtail/documents/locale/ja/LC_MESSAGES/django.po +1 -1
  690. wagtail/documents/locale/ka/LC_MESSAGES/django.po +1 -1
  691. wagtail/documents/locale/ko/LC_MESSAGES/django.mo +0 -0
  692. wagtail/documents/locale/ko/LC_MESSAGES/django.po +14 -2
  693. wagtail/documents/locale/lt/LC_MESSAGES/django.po +1 -1
  694. wagtail/documents/locale/lv/LC_MESSAGES/django.po +1 -1
  695. wagtail/documents/locale/mi/LC_MESSAGES/django.po +1 -1
  696. wagtail/documents/locale/mn/LC_MESSAGES/django.po +1 -1
  697. wagtail/documents/locale/my/LC_MESSAGES/django.po +1 -1
  698. wagtail/documents/locale/nb/LC_MESSAGES/django.mo +0 -0
  699. wagtail/documents/locale/nb/LC_MESSAGES/django.po +3 -2
  700. wagtail/documents/locale/nl/LC_MESSAGES/django.mo +0 -0
  701. wagtail/documents/locale/nl/LC_MESSAGES/django.po +2 -2
  702. wagtail/documents/locale/pl/LC_MESSAGES/django.mo +0 -0
  703. wagtail/documents/locale/pl/LC_MESSAGES/django.po +2 -2
  704. wagtail/documents/locale/pt_BR/LC_MESSAGES/django.mo +0 -0
  705. wagtail/documents/locale/pt_BR/LC_MESSAGES/django.po +2 -2
  706. wagtail/documents/locale/pt_PT/LC_MESSAGES/django.po +1 -1
  707. wagtail/documents/locale/ro/LC_MESSAGES/django.mo +0 -0
  708. wagtail/documents/locale/ro/LC_MESSAGES/django.po +2 -2
  709. wagtail/documents/locale/ru/LC_MESSAGES/django.mo +0 -0
  710. wagtail/documents/locale/ru/LC_MESSAGES/django.po +5 -2
  711. wagtail/documents/locale/sk_SK/LC_MESSAGES/django.mo +0 -0
  712. wagtail/documents/locale/sk_SK/LC_MESSAGES/django.po +2 -2
  713. wagtail/documents/locale/sl/LC_MESSAGES/django.mo +0 -0
  714. wagtail/documents/locale/sl/LC_MESSAGES/django.po +2 -2
  715. wagtail/documents/locale/sv/LC_MESSAGES/django.po +1 -1
  716. wagtail/documents/locale/tet/LC_MESSAGES/django.po +1 -1
  717. wagtail/documents/locale/th/LC_MESSAGES/django.po +1 -1
  718. wagtail/documents/locale/tr/LC_MESSAGES/django.po +1 -1
  719. wagtail/documents/locale/tr_TR/LC_MESSAGES/django.po +1 -1
  720. wagtail/documents/locale/ug/LC_MESSAGES/django.po +1 -1
  721. wagtail/documents/locale/uk/LC_MESSAGES/django.po +1 -1
  722. wagtail/documents/locale/vi/LC_MESSAGES/django.po +1 -1
  723. wagtail/documents/locale/zh/LC_MESSAGES/django.po +1 -1
  724. wagtail/documents/locale/zh_Hans/LC_MESSAGES/django.mo +0 -0
  725. wagtail/documents/locale/zh_Hans/LC_MESSAGES/django.po +3 -2
  726. wagtail/documents/locale/zh_Hant/LC_MESSAGES/django.po +1 -1
  727. wagtail/documents/rich_text/contentstate.py +1 -0
  728. wagtail/documents/rich_text/editor_html.py +1 -0
  729. wagtail/documents/tests/test_collection_privacy.py +1 -1
  730. wagtail/documents/tests/test_serializers.py +0 -1
  731. wagtail/documents/views/serve.py +0 -15
  732. wagtail/documents/wagtail_hooks.py +2 -17
  733. wagtail/embeds/locale/en/LC_MESSAGES/django.po +1 -1
  734. wagtail/embeds/rich_text/contentstate.py +1 -0
  735. wagtail/embeds/rich_text/editor_html.py +1 -0
  736. wagtail/embeds/wagtail_hooks.py +1 -1
  737. wagtail/images/formats.py +0 -11
  738. wagtail/images/locale/ar/LC_MESSAGES/django.po +1 -1
  739. wagtail/images/locale/az_AZ/LC_MESSAGES/django.po +1 -1
  740. wagtail/images/locale/be/LC_MESSAGES/django.po +1 -1
  741. wagtail/images/locale/bg/LC_MESSAGES/django.po +1 -1
  742. wagtail/images/locale/bn/LC_MESSAGES/django.po +1 -1
  743. wagtail/images/locale/ca/LC_MESSAGES/django.mo +0 -0
  744. wagtail/images/locale/ca/LC_MESSAGES/django.po +2 -2
  745. wagtail/images/locale/cs/LC_MESSAGES/django.mo +0 -0
  746. wagtail/images/locale/cs/LC_MESSAGES/django.po +3 -2
  747. wagtail/images/locale/cy/LC_MESSAGES/django.po +2 -1
  748. wagtail/images/locale/da/LC_MESSAGES/django.po +1 -1
  749. wagtail/images/locale/de/LC_MESSAGES/django.mo +0 -0
  750. wagtail/images/locale/de/LC_MESSAGES/django.po +3 -2
  751. wagtail/images/locale/dv/LC_MESSAGES/django.po +2 -1
  752. wagtail/images/locale/el/LC_MESSAGES/django.po +1 -1
  753. wagtail/images/locale/en/LC_MESSAGES/django.po +4 -4
  754. wagtail/images/locale/es/LC_MESSAGES/django.po +1 -1
  755. wagtail/images/locale/es_419/LC_MESSAGES/django.po +1 -1
  756. wagtail/images/locale/et/LC_MESSAGES/django.po +1 -1
  757. wagtail/images/locale/eu/LC_MESSAGES/django.po +1 -1
  758. wagtail/images/locale/fa/LC_MESSAGES/django.mo +0 -0
  759. wagtail/images/locale/fa/LC_MESSAGES/django.po +3 -2
  760. wagtail/images/locale/fi/LC_MESSAGES/django.mo +0 -0
  761. wagtail/images/locale/fi/LC_MESSAGES/django.po +2 -2
  762. wagtail/images/locale/fr/LC_MESSAGES/django.mo +0 -0
  763. wagtail/images/locale/fr/LC_MESSAGES/django.po +3 -2
  764. wagtail/images/locale/gl/LC_MESSAGES/django.mo +0 -0
  765. wagtail/images/locale/gl/LC_MESSAGES/django.po +2 -2
  766. wagtail/images/locale/he_IL/LC_MESSAGES/django.po +1 -1
  767. wagtail/images/locale/hr_HR/LC_MESSAGES/django.po +1 -1
  768. wagtail/images/locale/ht/LC_MESSAGES/django.po +1 -1
  769. wagtail/images/locale/hu/LC_MESSAGES/django.mo +0 -0
  770. wagtail/images/locale/hu/LC_MESSAGES/django.po +23 -3
  771. wagtail/images/locale/id_ID/LC_MESSAGES/django.po +1 -1
  772. wagtail/images/locale/is_IS/LC_MESSAGES/django.po +1 -1
  773. wagtail/images/locale/it/LC_MESSAGES/django.mo +0 -0
  774. wagtail/images/locale/it/LC_MESSAGES/django.po +2 -2
  775. wagtail/images/locale/ja/LC_MESSAGES/django.po +1 -1
  776. wagtail/images/locale/ka/LC_MESSAGES/django.po +1 -1
  777. wagtail/images/locale/ko/LC_MESSAGES/django.mo +0 -0
  778. wagtail/images/locale/ko/LC_MESSAGES/django.po +31 -2
  779. wagtail/images/locale/lt/LC_MESSAGES/django.po +1 -1
  780. wagtail/images/locale/lv/LC_MESSAGES/django.po +1 -1
  781. wagtail/images/locale/mi/LC_MESSAGES/django.po +1 -1
  782. wagtail/images/locale/mn/LC_MESSAGES/django.mo +0 -0
  783. wagtail/images/locale/mn/LC_MESSAGES/django.po +3 -2
  784. wagtail/images/locale/my/LC_MESSAGES/django.po +1 -1
  785. wagtail/images/locale/nb/LC_MESSAGES/django.mo +0 -0
  786. wagtail/images/locale/nb/LC_MESSAGES/django.po +3 -2
  787. wagtail/images/locale/nl/LC_MESSAGES/django.mo +0 -0
  788. wagtail/images/locale/nl/LC_MESSAGES/django.po +4 -5
  789. wagtail/images/locale/pl/LC_MESSAGES/django.mo +0 -0
  790. wagtail/images/locale/pl/LC_MESSAGES/django.po +2 -2
  791. wagtail/images/locale/pt_BR/LC_MESSAGES/django.mo +0 -0
  792. wagtail/images/locale/pt_BR/LC_MESSAGES/django.po +2 -2
  793. wagtail/images/locale/pt_PT/LC_MESSAGES/django.po +1 -1
  794. wagtail/images/locale/ro/LC_MESSAGES/django.mo +0 -0
  795. wagtail/images/locale/ro/LC_MESSAGES/django.po +3 -2
  796. wagtail/images/locale/ru/LC_MESSAGES/django.mo +0 -0
  797. wagtail/images/locale/ru/LC_MESSAGES/django.po +5 -2
  798. wagtail/images/locale/sk_SK/LC_MESSAGES/django.mo +0 -0
  799. wagtail/images/locale/sk_SK/LC_MESSAGES/django.po +2 -2
  800. wagtail/images/locale/sl/LC_MESSAGES/django.mo +0 -0
  801. wagtail/images/locale/sl/LC_MESSAGES/django.po +2 -2
  802. wagtail/images/locale/sv/LC_MESSAGES/django.mo +0 -0
  803. wagtail/images/locale/sv/LC_MESSAGES/django.po +2 -2
  804. wagtail/images/locale/tet/LC_MESSAGES/django.po +1 -1
  805. wagtail/images/locale/th/LC_MESSAGES/django.po +1 -1
  806. wagtail/images/locale/tr/LC_MESSAGES/django.po +1 -1
  807. wagtail/images/locale/tr_TR/LC_MESSAGES/django.po +1 -1
  808. wagtail/images/locale/ug/LC_MESSAGES/django.po +1 -1
  809. wagtail/images/locale/uk/LC_MESSAGES/django.mo +0 -0
  810. wagtail/images/locale/uk/LC_MESSAGES/django.po +5 -4
  811. wagtail/images/locale/vi/LC_MESSAGES/django.po +1 -1
  812. wagtail/images/locale/zh/LC_MESSAGES/django.po +1 -1
  813. wagtail/images/locale/zh_Hans/LC_MESSAGES/django.po +2 -1
  814. wagtail/images/locale/zh_Hant/LC_MESSAGES/django.po +1 -1
  815. wagtail/images/management/commands/wagtail_update_image_renditions.py +1 -1
  816. wagtail/images/models.py +23 -7
  817. wagtail/images/tests/test_admin_views.py +1 -1
  818. wagtail/images/tests/test_models.py +33 -0
  819. wagtail/images/tests/tests.py +0 -6
  820. wagtail/images/wagtail_hooks.py +2 -2
  821. wagtail/locale/af/LC_MESSAGES/django.po +1 -1
  822. wagtail/locale/ar/LC_MESSAGES/django.po +50 -50
  823. wagtail/locale/az_AZ/LC_MESSAGES/django.po +1 -1
  824. wagtail/locale/be/LC_MESSAGES/django.mo +0 -0
  825. wagtail/locale/be/LC_MESSAGES/django.po +52 -51
  826. wagtail/locale/bg/LC_MESSAGES/django.po +4 -4
  827. wagtail/locale/bn/LC_MESSAGES/django.po +1 -1
  828. wagtail/locale/ca/LC_MESSAGES/django.mo +0 -0
  829. wagtail/locale/ca/LC_MESSAGES/django.po +234 -234
  830. wagtail/locale/cs/LC_MESSAGES/django.mo +0 -0
  831. wagtail/locale/cs/LC_MESSAGES/django.po +172 -172
  832. wagtail/locale/cy/LC_MESSAGES/django.po +12 -12
  833. wagtail/locale/da/LC_MESSAGES/django.po +7 -7
  834. wagtail/locale/de/LC_MESSAGES/django.mo +0 -0
  835. wagtail/locale/de/LC_MESSAGES/django.po +237 -236
  836. wagtail/locale/dv/LC_MESSAGES/django.po +216 -215
  837. wagtail/locale/el/LC_MESSAGES/django.po +76 -75
  838. wagtail/locale/en/LC_MESSAGES/django.po +339 -339
  839. wagtail/locale/es/LC_MESSAGES/django.mo +0 -0
  840. wagtail/locale/es/LC_MESSAGES/django.po +192 -192
  841. wagtail/locale/es_419/LC_MESSAGES/django.po +1 -1
  842. wagtail/locale/et/LC_MESSAGES/django.mo +0 -0
  843. wagtail/locale/et/LC_MESSAGES/django.po +173 -173
  844. wagtail/locale/eu/LC_MESSAGES/django.po +1 -1
  845. wagtail/locale/fa/LC_MESSAGES/django.po +50 -50
  846. wagtail/locale/fi/LC_MESSAGES/django.mo +0 -0
  847. wagtail/locale/fi/LC_MESSAGES/django.po +187 -187
  848. wagtail/locale/fr/LC_MESSAGES/django.mo +0 -0
  849. wagtail/locale/fr/LC_MESSAGES/django.po +236 -235
  850. wagtail/locale/gl/LC_MESSAGES/django.mo +0 -0
  851. wagtail/locale/gl/LC_MESSAGES/django.po +235 -235
  852. wagtail/locale/he_IL/LC_MESSAGES/django.po +9 -9
  853. wagtail/locale/hr_HR/LC_MESSAGES/django.po +184 -184
  854. wagtail/locale/hu/LC_MESSAGES/django.mo +0 -0
  855. wagtail/locale/hu/LC_MESSAGES/django.po +251 -229
  856. wagtail/locale/id_ID/LC_MESSAGES/django.po +49 -49
  857. wagtail/locale/is_IS/LC_MESSAGES/django.po +232 -232
  858. wagtail/locale/it/LC_MESSAGES/django.mo +0 -0
  859. wagtail/locale/it/LC_MESSAGES/django.po +224 -224
  860. wagtail/locale/ja/LC_MESSAGES/django.po +110 -110
  861. wagtail/locale/ka/LC_MESSAGES/django.po +4 -4
  862. wagtail/locale/ko/LC_MESSAGES/django.mo +0 -0
  863. wagtail/locale/ko/LC_MESSAGES/django.po +88 -53
  864. wagtail/locale/lt/LC_MESSAGES/django.po +53 -53
  865. wagtail/locale/lv/LC_MESSAGES/django.po +22 -22
  866. wagtail/locale/mi/LC_MESSAGES/django.po +167 -167
  867. wagtail/locale/mn/LC_MESSAGES/django.mo +0 -0
  868. wagtail/locale/mn/LC_MESSAGES/django.po +51 -50
  869. wagtail/locale/my/LC_MESSAGES/django.po +6 -6
  870. wagtail/locale/nb/LC_MESSAGES/django.po +50 -50
  871. wagtail/locale/nl/LC_MESSAGES/django.mo +0 -0
  872. wagtail/locale/nl/LC_MESSAGES/django.po +233 -233
  873. wagtail/locale/pl/LC_MESSAGES/django.mo +0 -0
  874. wagtail/locale/pl/LC_MESSAGES/django.po +232 -232
  875. wagtail/locale/pt_BR/LC_MESSAGES/django.mo +0 -0
  876. wagtail/locale/pt_BR/LC_MESSAGES/django.po +202 -202
  877. wagtail/locale/pt_PT/LC_MESSAGES/django.mo +0 -0
  878. wagtail/locale/pt_PT/LC_MESSAGES/django.po +180 -178
  879. wagtail/locale/ro/LC_MESSAGES/django.mo +0 -0
  880. wagtail/locale/ro/LC_MESSAGES/django.po +233 -232
  881. wagtail/locale/ru/LC_MESSAGES/django.mo +0 -0
  882. wagtail/locale/ru/LC_MESSAGES/django.po +237 -234
  883. wagtail/locale/sk_SK/LC_MESSAGES/django.po +47 -47
  884. wagtail/locale/sl/LC_MESSAGES/django.mo +0 -0
  885. wagtail/locale/sl/LC_MESSAGES/django.po +233 -233
  886. wagtail/locale/sv/LC_MESSAGES/django.mo +0 -0
  887. wagtail/locale/sv/LC_MESSAGES/django.po +207 -207
  888. wagtail/locale/tet/LC_MESSAGES/django.po +37 -37
  889. wagtail/locale/th/LC_MESSAGES/django.mo +0 -0
  890. wagtail/locale/th/LC_MESSAGES/django.po +54 -53
  891. wagtail/locale/tr/LC_MESSAGES/django.po +50 -50
  892. wagtail/locale/tr_TR/LC_MESSAGES/django.po +50 -50
  893. wagtail/locale/ug/LC_MESSAGES/django.po +232 -232
  894. wagtail/locale/uk/LC_MESSAGES/django.mo +0 -0
  895. wagtail/locale/uk/LC_MESSAGES/django.po +185 -185
  896. wagtail/locale/vi/LC_MESSAGES/django.mo +0 -0
  897. wagtail/locale/vi/LC_MESSAGES/django.po +20 -19
  898. wagtail/locale/zh/LC_MESSAGES/django.po +4 -4
  899. wagtail/locale/zh_Hans/LC_MESSAGES/django.mo +0 -0
  900. wagtail/locale/zh_Hans/LC_MESSAGES/django.po +189 -189
  901. wagtail/locale/zh_Hant/LC_MESSAGES/django.po +161 -161
  902. wagtail/locales/locale/ar/LC_MESSAGES/django.po +1 -1
  903. wagtail/locales/locale/be/LC_MESSAGES/django.po +1 -1
  904. wagtail/locales/locale/bg/LC_MESSAGES/django.po +1 -1
  905. wagtail/locales/locale/ca/LC_MESSAGES/django.po +1 -1
  906. wagtail/locales/locale/cs/LC_MESSAGES/django.po +1 -1
  907. wagtail/locales/locale/cy/LC_MESSAGES/django.po +1 -1
  908. wagtail/locales/locale/da/LC_MESSAGES/django.po +1 -1
  909. wagtail/locales/locale/de/LC_MESSAGES/django.po +1 -1
  910. wagtail/locales/locale/dv/LC_MESSAGES/django.po +1 -1
  911. wagtail/locales/locale/el/LC_MESSAGES/django.po +1 -1
  912. wagtail/locales/locale/en/LC_MESSAGES/django.po +26 -14
  913. wagtail/locales/locale/es/LC_MESSAGES/django.po +1 -1
  914. wagtail/locales/locale/et/LC_MESSAGES/django.po +1 -1
  915. wagtail/locales/locale/fa/LC_MESSAGES/django.po +1 -1
  916. wagtail/locales/locale/fi/LC_MESSAGES/django.po +1 -1
  917. wagtail/locales/locale/fr/LC_MESSAGES/django.mo +0 -0
  918. wagtail/locales/locale/fr/LC_MESSAGES/django.po +14 -2
  919. wagtail/locales/locale/gl/LC_MESSAGES/django.mo +0 -0
  920. wagtail/locales/locale/gl/LC_MESSAGES/django.po +13 -3
  921. wagtail/locales/locale/he_IL/LC_MESSAGES/django.po +1 -1
  922. wagtail/locales/locale/hr_HR/LC_MESSAGES/django.po +1 -1
  923. wagtail/locales/locale/hu/LC_MESSAGES/django.po +1 -1
  924. wagtail/locales/locale/id_ID/LC_MESSAGES/django.po +1 -1
  925. wagtail/locales/locale/is_IS/LC_MESSAGES/django.po +1 -1
  926. wagtail/locales/locale/it/LC_MESSAGES/django.po +1 -1
  927. wagtail/locales/locale/ja/LC_MESSAGES/django.po +1 -1
  928. wagtail/locales/locale/ko/LC_MESSAGES/django.po +1 -1
  929. wagtail/locales/locale/lt/LC_MESSAGES/django.po +1 -1
  930. wagtail/locales/locale/lv/LC_MESSAGES/django.po +1 -1
  931. wagtail/locales/locale/mi/LC_MESSAGES/django.po +1 -1
  932. wagtail/locales/locale/mn/LC_MESSAGES/django.po +1 -1
  933. wagtail/locales/locale/my/LC_MESSAGES/django.po +1 -1
  934. wagtail/locales/locale/nb/LC_MESSAGES/django.po +1 -1
  935. wagtail/locales/locale/nl/LC_MESSAGES/django.po +1 -1
  936. wagtail/locales/locale/pl/LC_MESSAGES/django.po +1 -1
  937. wagtail/locales/locale/pt_BR/LC_MESSAGES/django.po +1 -1
  938. wagtail/locales/locale/pt_PT/LC_MESSAGES/django.po +1 -1
  939. wagtail/locales/locale/ro/LC_MESSAGES/django.po +1 -1
  940. wagtail/locales/locale/ru/LC_MESSAGES/django.po +1 -1
  941. wagtail/locales/locale/sk_SK/LC_MESSAGES/django.po +1 -1
  942. wagtail/locales/locale/sl/LC_MESSAGES/django.po +1 -1
  943. wagtail/locales/locale/sv/LC_MESSAGES/django.po +1 -1
  944. wagtail/locales/locale/tet/LC_MESSAGES/django.po +1 -1
  945. wagtail/locales/locale/th/LC_MESSAGES/django.po +1 -1
  946. wagtail/locales/locale/tr/LC_MESSAGES/django.po +1 -1
  947. wagtail/locales/locale/tr_TR/LC_MESSAGES/django.po +1 -1
  948. wagtail/locales/locale/ug/LC_MESSAGES/django.po +1 -1
  949. wagtail/locales/locale/uk/LC_MESSAGES/django.po +1 -1
  950. wagtail/locales/locale/vi/LC_MESSAGES/django.po +1 -1
  951. wagtail/locales/locale/zh/LC_MESSAGES/django.po +1 -1
  952. wagtail/locales/locale/zh_Hans/LC_MESSAGES/django.po +1 -1
  953. wagtail/locales/locale/zh_Hant/LC_MESSAGES/django.po +1 -1
  954. wagtail/locales/tests.py +32 -1
  955. wagtail/locales/views.py +39 -7
  956. wagtail/models/__init__.py +67 -5002
  957. wagtail/models/audit_log.py +1 -1
  958. wagtail/models/content_types.py +11 -0
  959. wagtail/models/draft_state.py +197 -0
  960. wagtail/models/locking.py +82 -0
  961. wagtail/models/orderable.py +10 -0
  962. wagtail/models/pages.py +2754 -0
  963. wagtail/models/preview.py +281 -0
  964. wagtail/models/reference_index.py +1 -1
  965. wagtail/models/revisions.py +433 -0
  966. wagtail/models/view_restrictions.py +3 -3
  967. wagtail/models/workflows.py +1348 -0
  968. wagtail/project_template/home/apps.py +6 -0
  969. wagtail/project_template/manage.py-tpl +22 -0
  970. wagtail/project_template/project_name/settings/base.py +1 -0
  971. wagtail/project_template/requirements.txt +2 -2
  972. wagtail/search/backends/base.py +4 -0
  973. wagtail/search/backends/database/mysql/query.py +8 -4
  974. wagtail/search/backends/elasticsearch7.py +17 -7
  975. wagtail/search/locale/en/LC_MESSAGES/django.po +1 -1
  976. wagtail/search/tests/elasticsearch_common_tests.py +43 -0
  977. wagtail/search/tests/test_backends.py +43 -13
  978. wagtail/search/tests/test_mysql_backend.py +22 -0
  979. wagtail/search/tests/test_page_search.py +2 -1
  980. wagtail/search/tests/test_queries.py +2 -2
  981. wagtail/sites/locale/en/LC_MESSAGES/django.po +1 -1
  982. wagtail/snippets/action_menu.py +9 -30
  983. wagtail/snippets/locale/af/LC_MESSAGES/django.po +1 -1
  984. wagtail/snippets/locale/ar/LC_MESSAGES/django.po +4 -4
  985. wagtail/snippets/locale/az_AZ/LC_MESSAGES/django.po +4 -4
  986. wagtail/snippets/locale/be/LC_MESSAGES/django.mo +0 -0
  987. wagtail/snippets/locale/be/LC_MESSAGES/django.po +6 -5
  988. wagtail/snippets/locale/bg/LC_MESSAGES/django.po +4 -4
  989. wagtail/snippets/locale/bn/LC_MESSAGES/django.po +4 -4
  990. wagtail/snippets/locale/ca/LC_MESSAGES/django.mo +0 -0
  991. wagtail/snippets/locale/ca/LC_MESSAGES/django.po +5 -5
  992. wagtail/snippets/locale/cs/LC_MESSAGES/django.po +5 -4
  993. wagtail/snippets/locale/cy/LC_MESSAGES/django.po +5 -4
  994. wagtail/snippets/locale/da/LC_MESSAGES/django.po +4 -4
  995. wagtail/snippets/locale/de/LC_MESSAGES/django.mo +0 -0
  996. wagtail/snippets/locale/de/LC_MESSAGES/django.po +6 -5
  997. wagtail/snippets/locale/dv/LC_MESSAGES/django.po +5 -4
  998. wagtail/snippets/locale/el/LC_MESSAGES/django.po +5 -4
  999. wagtail/snippets/locale/en/LC_MESSAGES/django.po +31 -23
  1000. wagtail/snippets/locale/en_IN/LC_MESSAGES/django.po +1 -1
  1001. wagtail/snippets/locale/es/LC_MESSAGES/django.mo +0 -0
  1002. wagtail/snippets/locale/es/LC_MESSAGES/django.po +6 -5
  1003. wagtail/snippets/locale/es_419/LC_MESSAGES/django.po +4 -4
  1004. wagtail/snippets/locale/es_VE/LC_MESSAGES/django.po +1 -1
  1005. wagtail/snippets/locale/et/LC_MESSAGES/django.po +4 -4
  1006. wagtail/snippets/locale/eu/LC_MESSAGES/django.po +1 -1
  1007. wagtail/snippets/locale/fa/LC_MESSAGES/django.mo +0 -0
  1008. wagtail/snippets/locale/fa/LC_MESSAGES/django.po +6 -5
  1009. wagtail/snippets/locale/fi/LC_MESSAGES/django.mo +0 -0
  1010. wagtail/snippets/locale/fi/LC_MESSAGES/django.po +6 -5
  1011. wagtail/snippets/locale/fr/LC_MESSAGES/django.mo +0 -0
  1012. wagtail/snippets/locale/fr/LC_MESSAGES/django.po +13 -6
  1013. wagtail/snippets/locale/gl/LC_MESSAGES/django.mo +0 -0
  1014. wagtail/snippets/locale/gl/LC_MESSAGES/django.po +11 -5
  1015. wagtail/snippets/locale/he_IL/LC_MESSAGES/django.po +4 -4
  1016. wagtail/snippets/locale/hi/LC_MESSAGES/django.po +1 -1
  1017. wagtail/snippets/locale/hr_HR/LC_MESSAGES/django.po +4 -4
  1018. wagtail/snippets/locale/ht/LC_MESSAGES/django.po +1 -1
  1019. wagtail/snippets/locale/hu/LC_MESSAGES/django.po +4 -4
  1020. wagtail/snippets/locale/id_ID/LC_MESSAGES/django.po +4 -4
  1021. wagtail/snippets/locale/is_IS/LC_MESSAGES/django.mo +0 -0
  1022. wagtail/snippets/locale/is_IS/LC_MESSAGES/django.po +5 -6
  1023. wagtail/snippets/locale/it/LC_MESSAGES/django.mo +0 -0
  1024. wagtail/snippets/locale/it/LC_MESSAGES/django.po +5 -5
  1025. wagtail/snippets/locale/ja/LC_MESSAGES/django.mo +0 -0
  1026. wagtail/snippets/locale/ja/LC_MESSAGES/django.po +6 -5
  1027. wagtail/snippets/locale/ka/LC_MESSAGES/django.po +4 -4
  1028. wagtail/snippets/locale/ko/LC_MESSAGES/django.po +4 -4
  1029. wagtail/snippets/locale/lt/LC_MESSAGES/django.po +4 -4
  1030. wagtail/snippets/locale/lv/LC_MESSAGES/django.po +4 -4
  1031. wagtail/snippets/locale/mi/LC_MESSAGES/django.po +4 -4
  1032. wagtail/snippets/locale/mn/LC_MESSAGES/django.po +4 -4
  1033. wagtail/snippets/locale/my/LC_MESSAGES/django.po +4 -4
  1034. wagtail/snippets/locale/nb/LC_MESSAGES/django.po +5 -4
  1035. wagtail/snippets/locale/nl/LC_MESSAGES/django.mo +0 -0
  1036. wagtail/snippets/locale/nl/LC_MESSAGES/django.po +5 -5
  1037. wagtail/snippets/locale/pl/LC_MESSAGES/django.mo +0 -0
  1038. wagtail/snippets/locale/pl/LC_MESSAGES/django.po +5 -5
  1039. wagtail/snippets/locale/pt_BR/LC_MESSAGES/django.mo +0 -0
  1040. wagtail/snippets/locale/pt_BR/LC_MESSAGES/django.po +7 -5
  1041. wagtail/snippets/locale/pt_PT/LC_MESSAGES/django.mo +0 -0
  1042. wagtail/snippets/locale/pt_PT/LC_MESSAGES/django.po +7 -5
  1043. wagtail/snippets/locale/ro/LC_MESSAGES/django.mo +0 -0
  1044. wagtail/snippets/locale/ro/LC_MESSAGES/django.po +6 -5
  1045. wagtail/snippets/locale/ru/LC_MESSAGES/django.mo +0 -0
  1046. wagtail/snippets/locale/ru/LC_MESSAGES/django.po +6 -5
  1047. wagtail/snippets/locale/sk_SK/LC_MESSAGES/django.po +4 -4
  1048. wagtail/snippets/locale/sl/LC_MESSAGES/django.mo +0 -0
  1049. wagtail/snippets/locale/sl/LC_MESSAGES/django.po +5 -5
  1050. wagtail/snippets/locale/sr/LC_MESSAGES/django.po +1 -1
  1051. wagtail/snippets/locale/sv/LC_MESSAGES/django.mo +0 -0
  1052. wagtail/snippets/locale/sv/LC_MESSAGES/django.po +5 -5
  1053. wagtail/snippets/locale/ta/LC_MESSAGES/django.po +1 -1
  1054. wagtail/snippets/locale/tet/LC_MESSAGES/django.po +4 -4
  1055. wagtail/snippets/locale/th/LC_MESSAGES/django.mo +0 -0
  1056. wagtail/snippets/locale/th/LC_MESSAGES/django.po +6 -5
  1057. wagtail/snippets/locale/tr/LC_MESSAGES/django.po +4 -4
  1058. wagtail/snippets/locale/tr_TR/LC_MESSAGES/django.po +4 -4
  1059. wagtail/snippets/locale/ug/LC_MESSAGES/django.po +4 -4
  1060. wagtail/snippets/locale/uk/LC_MESSAGES/django.mo +0 -0
  1061. wagtail/snippets/locale/uk/LC_MESSAGES/django.po +6 -6
  1062. wagtail/snippets/locale/vi/LC_MESSAGES/django.po +4 -4
  1063. wagtail/snippets/locale/zh/LC_MESSAGES/django.po +4 -4
  1064. wagtail/snippets/locale/zh_Hans/LC_MESSAGES/django.mo +0 -0
  1065. wagtail/snippets/locale/zh_Hans/LC_MESSAGES/django.po +6 -5
  1066. wagtail/snippets/locale/zh_Hant/LC_MESSAGES/django.po +4 -4
  1067. wagtail/snippets/permissions.py +6 -4
  1068. wagtail/snippets/static/wagtailsnippets/js/snippet-chooser-telepath.js +1 -1
  1069. wagtail/snippets/static/wagtailsnippets/js/snippet-chooser.js +1 -1
  1070. wagtail/snippets/templates/wagtailsnippets/snippets/action_menu/publish.html +3 -5
  1071. wagtail/snippets/tests/test_preview.py +62 -38
  1072. wagtail/snippets/tests/test_snippets.py +313 -130
  1073. wagtail/snippets/tests/test_viewset.py +69 -6
  1074. wagtail/snippets/tests/test_workflows.py +0 -4
  1075. wagtail/snippets/views/snippets.py +29 -53
  1076. wagtail/snippets/wagtail_hooks.py +3 -7
  1077. wagtail/test/apps.py +5 -0
  1078. wagtail/test/context_processors.py +19 -0
  1079. wagtail/test/customuser/forms.py +19 -0
  1080. wagtail/test/customuser/viewsets.py +12 -0
  1081. wagtail/test/settings.py +8 -9
  1082. wagtail/test/testapp/migrations/0046_alter_custom_rendition_to_unique_constraint.py +24 -0
  1083. wagtail/test/testapp/migrations/{0046_advertwithcustomuuidprimarykey_page.py → 0047_advertwithcustomuuidprimarykey_page.py} +1 -1
  1084. wagtail/test/testapp/migrations/0048_requireddatepage.py +36 -0
  1085. wagtail/test/testapp/migrations/0049_promotionalpage.py +35 -0
  1086. wagtail/test/testapp/migrations/0050_headcountrelatedmodelusingpk_related_page.py +25 -0
  1087. wagtail/test/testapp/migrations/0051_userapprovaltaskstate_userapprovaltask.py +59 -0
  1088. wagtail/test/testapp/models.py +183 -26
  1089. wagtail/test/testapp/templates/tests/workflows/approve_with_style.html +6 -0
  1090. wagtail/test/testapp/views.py +7 -1
  1091. wagtail/test/testapp/wagtail_hooks.py +6 -0
  1092. wagtail/test/utils/form_data.py +1 -0
  1093. wagtail/tests/test_blocks.py +0 -18
  1094. wagtail/tests/test_management_commands.py +1 -1
  1095. wagtail/tests/test_page_model.py +27 -0
  1096. wagtail/tests/test_page_privacy.py +1 -1
  1097. wagtail/tests/test_reference_index.py +26 -0
  1098. wagtail/tests/test_streamfield.py +136 -0
  1099. wagtail/tests/test_utils.py +1 -23
  1100. wagtail/users/forms.py +3 -17
  1101. wagtail/users/locale/ar/LC_MESSAGES/django.po +1 -1
  1102. wagtail/users/locale/be/LC_MESSAGES/django.mo +0 -0
  1103. wagtail/users/locale/be/LC_MESSAGES/django.po +3 -2
  1104. wagtail/users/locale/bg/LC_MESSAGES/django.po +1 -1
  1105. wagtail/users/locale/bn/LC_MESSAGES/django.po +1 -1
  1106. wagtail/users/locale/ca/LC_MESSAGES/django.mo +0 -0
  1107. wagtail/users/locale/ca/LC_MESSAGES/django.po +2 -2
  1108. wagtail/users/locale/cs/LC_MESSAGES/django.po +2 -1
  1109. wagtail/users/locale/cy/LC_MESSAGES/django.po +2 -1
  1110. wagtail/users/locale/da/LC_MESSAGES/django.po +1 -1
  1111. wagtail/users/locale/de/LC_MESSAGES/django.mo +0 -0
  1112. wagtail/users/locale/de/LC_MESSAGES/django.po +3 -3
  1113. wagtail/users/locale/dv/LC_MESSAGES/django.po +2 -1
  1114. wagtail/users/locale/el/LC_MESSAGES/django.po +1 -1
  1115. wagtail/users/locale/en/LC_MESSAGES/django.po +71 -71
  1116. wagtail/users/locale/es/LC_MESSAGES/django.po +1 -1
  1117. wagtail/users/locale/es_419/LC_MESSAGES/django.po +1 -1
  1118. wagtail/users/locale/et/LC_MESSAGES/django.po +1 -1
  1119. wagtail/users/locale/eu/LC_MESSAGES/django.po +1 -1
  1120. wagtail/users/locale/fa/LC_MESSAGES/django.mo +0 -0
  1121. wagtail/users/locale/fa/LC_MESSAGES/django.po +3 -2
  1122. wagtail/users/locale/fi/LC_MESSAGES/django.mo +0 -0
  1123. wagtail/users/locale/fi/LC_MESSAGES/django.po +2 -2
  1124. wagtail/users/locale/fr/LC_MESSAGES/django.mo +0 -0
  1125. wagtail/users/locale/fr/LC_MESSAGES/django.po +4 -2
  1126. wagtail/users/locale/gl/LC_MESSAGES/django.mo +0 -0
  1127. wagtail/users/locale/gl/LC_MESSAGES/django.po +2 -2
  1128. wagtail/users/locale/he_IL/LC_MESSAGES/django.po +1 -1
  1129. wagtail/users/locale/hr_HR/LC_MESSAGES/django.mo +0 -0
  1130. wagtail/users/locale/hr_HR/LC_MESSAGES/django.po +2 -2
  1131. wagtail/users/locale/hu/LC_MESSAGES/django.mo +0 -0
  1132. wagtail/users/locale/hu/LC_MESSAGES/django.po +45 -3
  1133. wagtail/users/locale/hy/LC_MESSAGES/django.po +1 -1
  1134. wagtail/users/locale/id_ID/LC_MESSAGES/django.po +1 -1
  1135. wagtail/users/locale/is_IS/LC_MESSAGES/django.po +1 -1
  1136. wagtail/users/locale/it/LC_MESSAGES/django.mo +0 -0
  1137. wagtail/users/locale/it/LC_MESSAGES/django.po +2 -2
  1138. wagtail/users/locale/ja/LC_MESSAGES/django.po +1 -1
  1139. wagtail/users/locale/ka/LC_MESSAGES/django.po +1 -1
  1140. wagtail/users/locale/ko/LC_MESSAGES/django.mo +0 -0
  1141. wagtail/users/locale/ko/LC_MESSAGES/django.po +47 -2
  1142. wagtail/users/locale/lt/LC_MESSAGES/django.po +1 -1
  1143. wagtail/users/locale/lv/LC_MESSAGES/django.po +1 -1
  1144. wagtail/users/locale/mi/LC_MESSAGES/django.po +1 -1
  1145. wagtail/users/locale/mn/LC_MESSAGES/django.mo +0 -0
  1146. wagtail/users/locale/mn/LC_MESSAGES/django.po +3 -2
  1147. wagtail/users/locale/my/LC_MESSAGES/django.po +1 -1
  1148. wagtail/users/locale/nb/LC_MESSAGES/django.po +2 -1
  1149. wagtail/users/locale/nl/LC_MESSAGES/django.mo +0 -0
  1150. wagtail/users/locale/nl/LC_MESSAGES/django.po +3 -2
  1151. wagtail/users/locale/pl/LC_MESSAGES/django.mo +0 -0
  1152. wagtail/users/locale/pl/LC_MESSAGES/django.po +2 -2
  1153. wagtail/users/locale/pt_BR/LC_MESSAGES/django.mo +0 -0
  1154. wagtail/users/locale/pt_BR/LC_MESSAGES/django.po +3 -2
  1155. wagtail/users/locale/pt_PT/LC_MESSAGES/django.mo +0 -0
  1156. wagtail/users/locale/pt_PT/LC_MESSAGES/django.po +3 -2
  1157. wagtail/users/locale/ro/LC_MESSAGES/django.mo +0 -0
  1158. wagtail/users/locale/ro/LC_MESSAGES/django.po +3 -2
  1159. wagtail/users/locale/ru/LC_MESSAGES/django.mo +0 -0
  1160. wagtail/users/locale/ru/LC_MESSAGES/django.po +4 -2
  1161. wagtail/users/locale/sk_SK/LC_MESSAGES/django.mo +0 -0
  1162. wagtail/users/locale/sk_SK/LC_MESSAGES/django.po +2 -2
  1163. wagtail/users/locale/sl/LC_MESSAGES/django.mo +0 -0
  1164. wagtail/users/locale/sl/LC_MESSAGES/django.po +2 -2
  1165. wagtail/users/locale/sv/LC_MESSAGES/django.mo +0 -0
  1166. wagtail/users/locale/sv/LC_MESSAGES/django.po +2 -2
  1167. wagtail/users/locale/tet/LC_MESSAGES/django.po +1 -1
  1168. wagtail/users/locale/th/LC_MESSAGES/django.mo +0 -0
  1169. wagtail/users/locale/th/LC_MESSAGES/django.po +3 -2
  1170. wagtail/users/locale/tr/LC_MESSAGES/django.po +1 -1
  1171. wagtail/users/locale/tr_TR/LC_MESSAGES/django.po +1 -1
  1172. wagtail/users/locale/ug/LC_MESSAGES/django.po +1 -1
  1173. wagtail/users/locale/uk/LC_MESSAGES/django.mo +0 -0
  1174. wagtail/users/locale/uk/LC_MESSAGES/django.po +3 -2
  1175. wagtail/users/locale/vi/LC_MESSAGES/django.po +2 -1
  1176. wagtail/users/locale/zh/LC_MESSAGES/django.po +1 -1
  1177. wagtail/users/locale/zh_Hans/LC_MESSAGES/django.mo +0 -0
  1178. wagtail/users/locale/zh_Hans/LC_MESSAGES/django.po +3 -2
  1179. wagtail/users/locale/zh_Hant/LC_MESSAGES/django.po +1 -1
  1180. wagtail/users/models.py +7 -1
  1181. wagtail/users/templatetags/wagtailusers_tags.py +0 -29
  1182. wagtail/users/tests/__init__.py +0 -6
  1183. wagtail/users/tests/test_admin_views.py +285 -611
  1184. wagtail/users/views/groups.py +1 -28
  1185. wagtail/users/views/users.py +3 -45
  1186. wagtail/utils/deprecation.py +3 -3
  1187. wagtail/whitelist.py +1 -0
  1188. wagtail/workflows.py +2 -2
  1189. wagtail-7.0rc1.dist-info/METADATA +224 -0
  1190. {wagtail-6.4.1.dist-info → wagtail-7.0rc1.dist-info}/RECORD +1194 -1174
  1191. {wagtail-6.4.1.dist-info → wagtail-7.0rc1.dist-info}/WHEEL +1 -1
  1192. wagtail/admin/templates/wagtailadmin/shared/ajax_pagination_nav.html +0 -25
  1193. wagtail/project_template/manage.py +0 -10
  1194. wagtail/utils/setup.py +0 -90
  1195. wagtail/utils/widgets.py +0 -46
  1196. wagtail-6.4.1.dist-info/METADATA +0 -77
  1197. {wagtail-6.4.1.dist-info → wagtail-7.0rc1.dist-info}/entry_points.txt +0 -0
  1198. {wagtail-6.4.1.dist-info → wagtail-7.0rc1.dist-info/licenses}/LICENSE +0 -0
  1199. {wagtail-6.4.1.dist-info → wagtail-7.0rc1.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,5 @@
1
1
  import unittest.mock
2
2
 
3
- from django import forms
4
3
  from django.apps import apps
5
4
  from django.conf import settings
6
5
  from django.contrib.admin.utils import quote
@@ -11,7 +10,6 @@ from django.core.exceptions import ImproperlyConfigured
11
10
  from django.core.files.uploadedfile import SimpleUploadedFile
12
11
  from django.db.models import Q
13
12
  from django.http import HttpRequest, HttpResponse
14
- from django.template import RequestContext, Template
15
13
  from django.test import TestCase, override_settings
16
14
  from django.urls import reverse
17
15
  from django.utils import timezone
@@ -23,7 +21,6 @@ from wagtail.admin.models import Admin
23
21
  from wagtail.admin.staticfiles import versioned_static
24
22
  from wagtail.admin.widgets.button import ButtonWithDropdown
25
23
  from wagtail.compat import AUTH_USER_APP_LABEL, AUTH_USER_MODEL_NAME
26
- from wagtail.coreutils import get_dummy_request
27
24
  from wagtail.log_actions import log
28
25
  from wagtail.models import (
29
26
  Collection,
@@ -33,20 +30,17 @@ from wagtail.models import (
33
30
  LockableMixin,
34
31
  Page,
35
32
  )
33
+ from wagtail.test.customuser.forms import CustomUserCreationForm, CustomUserEditForm
34
+ from wagtail.test.customuser.viewsets import CustomUserViewSet
36
35
  from wagtail.test.utils import WagtailTestUtils
37
36
  from wagtail.test.utils.template_tests import AdminTemplateTestUtils
38
- from wagtail.users.forms import GroupForm, UserCreationForm, UserEditForm
37
+ from wagtail.users.forms import GroupForm
39
38
  from wagtail.users.models import UserProfile
40
39
  from wagtail.users.permission_order import register as register_permission_order
41
40
  from wagtail.users.views.groups import GroupViewSet
42
- from wagtail.users.views.users import (
43
- UserViewSet,
44
- get_user_creation_form,
45
- get_user_edit_form,
46
- )
41
+ from wagtail.users.views.users import UserViewSet
47
42
  from wagtail.users.wagtail_hooks import get_viewset_cls
48
43
  from wagtail.users.widgets import UserListingButton
49
- from wagtail.utils.deprecation import RemovedInWagtail70Warning
50
44
 
51
45
  add_user_perm_codename = f"add_{AUTH_USER_MODEL_NAME.lower()}"
52
46
  delete_user_perm_codename = f"delete_{AUTH_USER_MODEL_NAME.lower()}"
@@ -63,16 +57,6 @@ class CustomGroupForm(GroupForm):
63
57
  pass
64
58
 
65
59
 
66
- class CustomUserCreationForm(UserCreationForm):
67
- country = forms.CharField(required=True, label="Country")
68
- attachment = forms.FileField(required=True, label="Attachment")
69
-
70
-
71
- class CustomUserEditForm(UserEditForm):
72
- country = forms.CharField(required=True, label="Country")
73
- attachment = forms.FileField(required=True, label="Attachment")
74
-
75
-
76
60
  class CustomGroupViewSet(GroupViewSet):
77
61
  icon = "custom-icon"
78
62
 
@@ -80,110 +64,6 @@ class CustomGroupViewSet(GroupViewSet):
80
64
  return CustomGroupForm
81
65
 
82
66
 
83
- class CustomUserViewSet(UserViewSet):
84
- icon = "custom-icon"
85
-
86
- def get_form_class(self, for_update=False):
87
- if for_update:
88
- return CustomUserEditForm
89
- return CustomUserCreationForm
90
-
91
-
92
- class TestUserFormHelpers(TestCase):
93
- def test_get_user_edit_form_with_default_form(self):
94
- user_form = get_user_edit_form()
95
- self.assertIs(user_form, UserEditForm)
96
-
97
- def test_get_user_creation_form_with_default_form(self):
98
- user_form = get_user_creation_form()
99
- self.assertIs(user_form, UserCreationForm)
100
-
101
- @override_settings(
102
- WAGTAIL_USER_CREATION_FORM="wagtail.users.tests.CustomUserCreationForm"
103
- )
104
- def test_get_user_creation_form_with_custom_form(self):
105
- with self.assertWarnsMessage(
106
- RemovedInWagtail70Warning,
107
- "The `WAGTAIL_USER_CREATION_FORM` setting is deprecated. Use a custom "
108
- "`UserViewSet` subclass and override `get_form_class()` instead.",
109
- ):
110
- user_form = get_user_creation_form()
111
- self.assertIs(user_form, CustomUserCreationForm)
112
-
113
- @override_settings(WAGTAIL_USER_EDIT_FORM="wagtail.users.tests.CustomUserEditForm")
114
- def test_get_user_edit_form_with_custom_form(self):
115
- with self.assertWarnsMessage(
116
- RemovedInWagtail70Warning,
117
- "The `WAGTAIL_USER_EDIT_FORM` setting is deprecated. Use a custom "
118
- "`UserViewSet` subclass and override `get_form_class()` instead.",
119
- ):
120
- user_form = get_user_edit_form()
121
- self.assertIs(user_form, CustomUserEditForm)
122
-
123
- @override_settings(
124
- WAGTAIL_USER_CREATION_FORM="wagtail.users.tests.CustomUserCreationFormDoesNotExist"
125
- )
126
- def test_get_user_creation_form_with_invalid_form(self):
127
- with self.assertWarnsMessage(
128
- RemovedInWagtail70Warning,
129
- "The `WAGTAIL_USER_CREATION_FORM` setting is deprecated. Use a custom "
130
- "`UserViewSet` subclass and override `get_form_class()` instead.",
131
- ):
132
- self.assertRaises(ImproperlyConfigured, get_user_creation_form)
133
-
134
- @override_settings(
135
- WAGTAIL_USER_EDIT_FORM="wagtail.users.tests.CustomUserEditFormDoesNotExist"
136
- )
137
- def test_get_user_edit_form_with_invalid_form(self):
138
- with self.assertWarnsMessage(
139
- RemovedInWagtail70Warning,
140
- "The `WAGTAIL_USER_EDIT_FORM` setting is deprecated. Use a custom "
141
- "`UserViewSet` subclass and override `get_form_class()` instead.",
142
- ):
143
- self.assertRaises(ImproperlyConfigured, get_user_edit_form)
144
-
145
-
146
- class TestGroupUsersView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
147
- def setUp(self):
148
- # create a user that should be visible in the listing
149
- self.test_user = self.create_user(
150
- username="testuser",
151
- email="testuser@email.com",
152
- password="password",
153
- first_name="First Name",
154
- last_name="Last Name",
155
- )
156
- self.test_group = Group.objects.create(name="Test Group")
157
- self.test_user.groups.add(self.test_group)
158
- self.login()
159
-
160
- def get(self, params={}, group_id=None):
161
- return self.client.get(
162
- reverse(
163
- "wagtailusers_groups:users", args=(group_id or self.test_group.pk,)
164
- ),
165
- params,
166
- )
167
-
168
- def test_simple(self):
169
- with self.assertWarnsMessage(
170
- RemovedInWagtail70Warning,
171
- "Accessing the list of users in a group via "
172
- f"/admin/groups/{self.test_group.pk}/users/ is deprecated, use "
173
- f"/admin/users/?group={self.test_group.pk} instead.",
174
- ):
175
- response = self.get()
176
-
177
- self.assertRedirects(
178
- response,
179
- reverse("wagtailusers_users:index") + f"?group={self.test_group.pk}",
180
- )
181
-
182
- def test_inexisting_group(self):
183
- response = self.get(group_id=9999)
184
- self.assertEqual(response.status_code, 404)
185
-
186
-
187
67
  class TestUserIndexView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
188
68
  def setUp(self):
189
69
  # create a user that should be visible in the listing
@@ -456,6 +336,21 @@ class TestUserIndexResultsView(AdminTemplateTestUtils, WagtailTestUtils, TestCas
456
336
  class TestUserCreateView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
457
337
  def setUp(self):
458
338
  self.login()
339
+ self.post_data = {
340
+ "username": "testuser",
341
+ "email": "test@user.com",
342
+ "first_name": "Test",
343
+ "last_name": "User",
344
+ "password1": "password",
345
+ "password2": "password",
346
+ }
347
+ if settings.AUTH_USER_MODEL == "customuser.CustomUser":
348
+ self.post_data.update(
349
+ {
350
+ "country": "testcountry",
351
+ "attachment": SimpleUploadedFile("test.txt", b"Uploaded file"),
352
+ }
353
+ )
459
354
 
460
355
  def get(self, params={}):
461
356
  return self.client.get(reverse("wagtailusers_users:add"), params)
@@ -484,14 +379,7 @@ class TestUserCreateView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
484
379
 
485
380
  def test_create(self):
486
381
  response = self.post(
487
- {
488
- "username": "testuser",
489
- "email": "test@user.com",
490
- "first_name": "Test",
491
- "last_name": "User",
492
- "password1": "password",
493
- "password2": "password",
494
- },
382
+ self.post_data,
495
383
  follow=True,
496
384
  )
497
385
 
@@ -505,50 +393,18 @@ class TestUserCreateView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
505
393
  self.assertContains(response, "User 'test@user.com' created.")
506
394
  else:
507
395
  self.assertContains(response, "User 'testuser' created.")
508
-
509
- @unittest.skipUnless(
510
- settings.AUTH_USER_MODEL == "customuser.CustomUser",
511
- "Only applicable to CustomUser",
512
- )
513
- @override_settings(
514
- WAGTAIL_USER_CREATION_FORM="wagtail.users.tests.CustomUserCreationForm",
515
- )
516
- def test_create_with_custom_form(self):
517
- response = self.post(
518
- {
519
- "username": "testuser",
520
- "email": "test@user.com",
521
- "first_name": "Test",
522
- "last_name": "User",
523
- "password1": "password",
524
- "password2": "password",
525
- "country": "testcountry",
526
- "attachment": SimpleUploadedFile("test.txt", b"Uploaded file"),
527
- }
528
- )
529
-
530
- # Should redirect back to index
531
- self.assertRedirects(response, reverse("wagtailusers_users:index"))
532
-
533
- # Check that the user was created
534
- users = get_user_model().objects.filter(email="test@user.com")
535
- self.assertEqual(users.count(), 1)
536
- self.assertEqual(users.first().country, "testcountry")
537
- self.assertEqual(users.first().attachment.read(), b"Uploaded file")
396
+ self.assertEqual(users.first().country, "testcountry")
397
+ self.assertEqual(users.first().attachment.read(), b"Uploaded file")
538
398
 
539
399
  def test_create_with_whitespaced_password(self):
540
400
  """Password should not be stripped"""
541
- self.post(
542
- {
543
- "username": "testuser2",
544
- "email": "test@user2.com",
545
- "first_name": "Test",
546
- "last_name": "User",
547
- "password1": " whitespaced_password ",
548
- "password2": " whitespaced_password ",
549
- },
550
- follow=True,
551
- )
401
+ post_data = self.post_data.copy()
402
+ post_data["username"] = "testuser2"
403
+ post_data["email"] = "test@user2.com"
404
+ post_data["password1"] = " whitespaced_password "
405
+ post_data["password2"] = " whitespaced_password "
406
+
407
+ self.post(post_data, follow=True)
552
408
  # Try to login with the password
553
409
  self.client.logout()
554
410
  username = "testuser2"
@@ -557,16 +413,10 @@ class TestUserCreateView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
557
413
  self.login(username=username, password=" whitespaced_password ")
558
414
 
559
415
  def test_create_with_password_mismatch(self):
560
- response = self.post(
561
- {
562
- "username": "testuser",
563
- "email": "test@user.com",
564
- "first_name": "Test",
565
- "last_name": "User",
566
- "password1": "password1",
567
- "password2": "password2",
568
- }
569
- )
416
+ post_data = self.post_data.copy()
417
+ post_data["password1"] = "password1"
418
+ post_data["password2"] = "password2"
419
+ response = self.post(post_data)
570
420
 
571
421
  # Should remain on page
572
422
  self.assertEqual(response.status_code, 200)
@@ -591,17 +441,13 @@ class TestUserCreateView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
591
441
  Specifically test that the UserAttributeSimilarityValidator works,
592
442
  which requires a full-populated user model before the validation works.
593
443
  """
444
+ post_data = self.post_data.copy()
594
445
  # Create a user with a password the same as their name
595
- response = self.post(
596
- {
597
- "username": "testuser",
598
- "email": "test@user.com",
599
- "first_name": "Example",
600
- "last_name": "Name",
601
- "password1": "example name",
602
- "password2": "example name",
603
- }
604
- )
446
+ post_data["first_name"] = "Example"
447
+ post_data["last_name"] = "Name"
448
+ post_data["password1"] = "example name"
449
+ post_data["password2"] = "example name"
450
+ response = self.post(post_data)
605
451
 
606
452
  # Should remain on page
607
453
  self.assertEqual(response.status_code, 200)
@@ -618,16 +464,10 @@ class TestUserCreateView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
618
464
 
619
465
  def test_create_with_missing_password(self):
620
466
  """Password should be required by default"""
621
- response = self.post(
622
- {
623
- "username": "testuser",
624
- "email": "test@user.com",
625
- "first_name": "Test",
626
- "last_name": "User",
627
- "password1": "",
628
- "password2": "",
629
- }
630
- )
467
+ post_data = self.post_data.copy()
468
+ post_data["password1"] = ""
469
+ post_data["password2"] = ""
470
+ response = self.post(post_data)
631
471
 
632
472
  # Should remain on page
633
473
  self.assertEqual(response.status_code, 200)
@@ -651,16 +491,11 @@ class TestUserCreateView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
651
491
  @override_settings(WAGTAILUSERS_PASSWORD_REQUIRED=False)
652
492
  def test_create_with_password_not_required(self):
653
493
  """Password should not be required if WAGTAILUSERS_PASSWORD_REQUIRED is False"""
654
- response = self.post(
655
- {
656
- "username": "testuser",
657
- "email": "test@user.com",
658
- "first_name": "Test",
659
- "last_name": "User",
660
- "password1": "",
661
- "password2": "",
662
- }
663
- )
494
+ post_data = self.post_data.copy()
495
+ post_data["password1"] = ""
496
+ post_data["password2"] = ""
497
+
498
+ response = self.post(post_data)
664
499
 
665
500
  # Should redirect back to index
666
501
  self.assertRedirects(response, reverse("wagtailusers_users:index"))
@@ -673,16 +508,11 @@ class TestUserCreateView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
673
508
  @override_settings(WAGTAILUSERS_PASSWORD_REQUIRED=False)
674
509
  def test_optional_password_is_still_validated(self):
675
510
  """When WAGTAILUSERS_PASSWORD_REQUIRED is False, password validation should still apply if a password _is_ supplied"""
676
- response = self.post(
677
- {
678
- "username": "testuser",
679
- "email": "test@user.com",
680
- "first_name": "Test",
681
- "last_name": "User",
682
- "password1": "banana",
683
- "password2": "kumquat",
684
- }
685
- )
511
+ post_data = self.post_data.copy()
512
+ post_data["password1"] = "banana"
513
+ post_data["password2"] = "kumquat"
514
+
515
+ response = self.post(post_data)
686
516
 
687
517
  # Should remain on page
688
518
  self.assertEqual(response.status_code, 200)
@@ -697,16 +527,11 @@ class TestUserCreateView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
697
527
  @override_settings(WAGTAILUSERS_PASSWORD_REQUIRED=False)
698
528
  def test_password_still_accepted_when_optional(self):
699
529
  """When WAGTAILUSERS_PASSWORD_REQUIRED is False, we should still allow a password to be set"""
700
- response = self.post(
701
- {
702
- "username": "testuser",
703
- "email": "test@user.com",
704
- "first_name": "Test",
705
- "last_name": "User",
706
- "password1": "banana",
707
- "password2": "banana",
708
- }
709
- )
530
+ post_data = self.post_data.copy()
531
+ post_data["password1"] = "banana"
532
+ post_data["password2"] = "banana"
533
+
534
+ response = self.post(post_data)
710
535
 
711
536
  # Should redirect back to index
712
537
  self.assertRedirects(response, reverse("wagtailusers_users:index"))
@@ -728,16 +553,10 @@ class TestUserCreateView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
728
553
  @override_settings(WAGTAILUSERS_PASSWORD_ENABLED=False)
729
554
  def test_password_fields_ignored_when_disabled(self):
730
555
  """When WAGTAILUSERS_PASSWORD_ENABLED is False, users should always be created without a usable password"""
731
- response = self.post(
732
- {
733
- "username": "testuser",
734
- "email": "test@user.com",
735
- "first_name": "Test",
736
- "last_name": "User",
737
- "password1": "banana", # not part of the form - should be ignored
738
- "password2": "kumquat", # not part of the form - should be ignored
739
- }
740
- )
556
+ post_data = self.post_data.copy()
557
+ post_data["password1"] = "banana" # not part of the form - should be ignored
558
+ post_data["password2"] = "kumquat" # not part of the form - should be ignored
559
+ response = self.post(post_data)
741
560
 
742
561
  # Should redirect back to index
743
562
  self.assertRedirects(response, reverse("wagtailusers_users:index"))
@@ -763,15 +582,9 @@ class TestUserCreateView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
763
582
  return HttpResponse("Overridden!")
764
583
 
765
584
  with self.register_hook("before_create_user", hook_func):
766
- post_data = {
767
- "username": "testuser",
768
- "email": "testuser@test.com",
769
- "password1": "password12",
770
- "password2": "password12",
771
- "first_name": "test",
772
- "last_name": "user",
773
- }
774
- response = self.client.post(reverse("wagtailusers_users:add"), post_data)
585
+ response = self.client.post(
586
+ reverse("wagtailusers_users:add"), self.post_data
587
+ )
775
588
  self.assertEqual(response.status_code, 200)
776
589
  self.assertEqual(response.content, b"Overridden!")
777
590
 
@@ -782,15 +595,9 @@ class TestUserCreateView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
782
595
  return HttpResponse("Overridden!")
783
596
 
784
597
  with self.register_hook("after_create_user", hook_func):
785
- post_data = {
786
- "username": "testuser",
787
- "email": "testuser@test.com",
788
- "password1": "password12",
789
- "password2": "password12",
790
- "first_name": "test",
791
- "last_name": "user",
792
- }
793
- response = self.client.post(reverse("wagtailusers_users:add"), post_data)
598
+ response = self.client.post(
599
+ reverse("wagtailusers_users:add"), self.post_data
600
+ )
794
601
  self.assertEqual(response.status_code, 200)
795
602
  self.assertEqual(response.content, b"Overridden!")
796
603
 
@@ -1002,6 +809,23 @@ class TestUserEditView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
1002
809
  password="password",
1003
810
  )
1004
811
 
812
+ self.post_data = {
813
+ "username": "testuser",
814
+ "email": "test@user.com",
815
+ "first_name": "Edited",
816
+ "last_name": "User",
817
+ "password1": "newpassword",
818
+ "password2": "newpassword",
819
+ "is_active": "on",
820
+ }
821
+ if settings.AUTH_USER_MODEL == "customuser.CustomUser":
822
+ self.post_data.update(
823
+ {
824
+ "country": "testcountry",
825
+ "attachment": SimpleUploadedFile("test.txt", b"Uploaded file"),
826
+ }
827
+ )
828
+
1005
829
  # Login
1006
830
  self.current_user = self.login()
1007
831
 
@@ -1049,22 +873,6 @@ class TestUserEditView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
1049
873
  url_finder = AdminURLFinder(self.current_user)
1050
874
  self.assertEqual(url_finder.get_edit_url(self.test_user), edit_url)
1051
875
 
1052
- def test_legacy_url_redirect(self):
1053
- with self.assertWarnsMessage(
1054
- RemovedInWagtail70Warning,
1055
- (
1056
- "UserViewSet's `/<pk>/` edit view URL pattern has been "
1057
- "deprecated in favour of /edit/<pk>/."
1058
- ),
1059
- ):
1060
- response = self.client.get(f"/admin/users/{self.test_user.pk}/")
1061
-
1062
- self.assertRedirects(
1063
- response,
1064
- f"/admin/users/edit/{self.test_user.pk}/",
1065
- status_code=301,
1066
- )
1067
-
1068
876
  def test_nonexistent_redirect(self):
1069
877
  invalid_id = (
1070
878
  "99999999-9999-9999-9999-999999999999"
@@ -1074,18 +882,7 @@ class TestUserEditView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
1074
882
  self.assertEqual(self.get(user_id=invalid_id).status_code, 404)
1075
883
 
1076
884
  def test_simple_post(self):
1077
- response = self.post(
1078
- {
1079
- "username": "testuser",
1080
- "email": "test@user.com",
1081
- "first_name": "Edited",
1082
- "last_name": "User",
1083
- "password1": "newpassword",
1084
- "password2": "newpassword",
1085
- "is_active": "on",
1086
- },
1087
- follow=True,
1088
- )
885
+ response = self.post(self.post_data, follow=True)
1089
886
  # Should redirect back to index
1090
887
  self.assertRedirects(response, reverse("wagtailusers_users:index"))
1091
888
 
@@ -1097,6 +894,8 @@ class TestUserEditView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
1097
894
  self.assertContains(response, "User &#x27;test@user.com&#x27; updated.")
1098
895
  else:
1099
896
  self.assertContains(response, "User &#x27;testuser&#x27; updated.")
897
+ self.assertEqual(user.country, "testcountry")
898
+ self.assertEqual(user.attachment.read(), b"Uploaded file")
1100
899
 
1101
900
  # On next load of the edit view,
1102
901
  # should render the status panel with the last updated time
@@ -1117,17 +916,10 @@ class TestUserEditView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
1117
916
 
1118
917
  def test_password_optional(self):
1119
918
  """Leaving password fields blank should leave it unchanged"""
1120
- response = self.post(
1121
- {
1122
- "username": "testuser",
1123
- "email": "test@user.com",
1124
- "first_name": "Edited",
1125
- "last_name": "User",
1126
- "password1": "",
1127
- "password2": "",
1128
- "is_active": "on",
1129
- }
1130
- )
919
+ post_data = self.post_data.copy()
920
+ post_data["password1"] = ""
921
+ post_data["password2"] = ""
922
+ response = self.post(post_data)
1131
923
  # Should redirect back to index
1132
924
  self.assertRedirects(response, reverse("wagtailusers_users:index"))
1133
925
 
@@ -1138,17 +930,10 @@ class TestUserEditView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
1138
930
 
1139
931
  def test_passwords_match(self):
1140
932
  """Password fields should be validated if supplied"""
1141
- response = self.post(
1142
- {
1143
- "username": "testuser",
1144
- "email": "test@user.com",
1145
- "first_name": "Edited",
1146
- "last_name": "User",
1147
- "password1": "banana",
1148
- "password2": "kumquat",
1149
- "is_active": "on",
1150
- }
1151
- )
933
+ post_data = self.post_data.copy()
934
+ post_data["password1"] = "banana"
935
+ post_data["password2"] = "kumquat"
936
+ response = self.post(post_data)
1152
937
  # Should remain on page
1153
938
  self.assertEqual(response.status_code, 200)
1154
939
  self.assertTemplateUsed(response, "wagtailusers/users/edit.html")
@@ -1174,16 +959,12 @@ class TestUserEditView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
1174
959
  which requires a full-populated user model before the validation works.
1175
960
  """
1176
961
  # Create a user with a password the same as their name
1177
- response = self.post(
1178
- {
1179
- "username": "testuser",
1180
- "email": "test@user.com",
1181
- "first_name": "Edited",
1182
- "last_name": "Name",
1183
- "password1": "edited name",
1184
- "password2": "edited name",
1185
- }
1186
- )
962
+ post_data = self.post_data.copy()
963
+ post_data["first_name"] = "Edited"
964
+ post_data["last_name"] = "Name"
965
+ post_data["password1"] = "edited name"
966
+ post_data["password2"] = "edited name"
967
+ response = self.post(post_data)
1187
968
 
1188
969
  # Should remain on page
1189
970
  self.assertEqual(response.status_code, 200)
@@ -1200,19 +981,10 @@ class TestUserEditView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
1200
981
  self.assertTrue(user.check_password("password"))
1201
982
 
1202
983
  def test_edit_and_deactivate(self):
1203
- response = self.post(
1204
- {
1205
- "username": "testuser",
1206
- "email": "test@user.com",
1207
- "first_name": "Edited",
1208
- "last_name": "User",
1209
- "password1": "password",
1210
- "password2": "password",
1211
- # Leaving out these fields, thus setting them to False:
1212
- # 'is_active': 'on'
1213
- # 'is_superuser': 'on',
1214
- }
1215
- )
984
+ post_data = self.post_data.copy()
985
+ del post_data["is_active"]
986
+
987
+ response = self.post(post_data)
1216
988
 
1217
989
  # Should redirect back to index
1218
990
  self.assertRedirects(response, reverse("wagtailusers_users:index"))
@@ -1226,18 +998,9 @@ class TestUserEditView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
1226
998
  self.assertIs(user.is_active, False)
1227
999
 
1228
1000
  def test_edit_and_make_superuser(self):
1229
- response = self.post(
1230
- {
1231
- "username": "testuser",
1232
- "email": "test@user.com",
1233
- "first_name": "Edited",
1234
- "last_name": "User",
1235
- "password1": "password",
1236
- "password2": "password",
1237
- "is_active": "on",
1238
- "is_superuser": "on",
1239
- }
1240
- )
1001
+ post_data = self.post_data.copy()
1002
+ post_data["is_superuser"] = "on"
1003
+ response = self.post(post_data)
1241
1004
 
1242
1005
  # Should redirect back to index
1243
1006
  self.assertRedirects(response, reverse("wagtailusers_users:index"))
@@ -1251,19 +1014,25 @@ class TestUserEditView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
1251
1014
  self.assertIs(user.is_active, True)
1252
1015
 
1253
1016
  def test_edit_self(self):
1254
- response = self.post(
1255
- {
1256
- "username": "test@email.com",
1257
- "email": "test@email.com",
1258
- "first_name": "Edited Myself",
1259
- "last_name": "User",
1260
- # 'password1': "password",
1261
- # 'password2': "password",
1262
- "is_active": "on",
1263
- "is_superuser": "on",
1264
- },
1265
- self.current_user.pk,
1266
- )
1017
+ post_data = {
1018
+ "username": "test@email.com",
1019
+ "email": "test@email.com",
1020
+ "first_name": "Edited Myself",
1021
+ "last_name": "User",
1022
+ # 'password1': "password",
1023
+ # 'password2': "password",
1024
+ "is_active": "on",
1025
+ "is_superuser": "on",
1026
+ }
1027
+ if settings.AUTH_USER_MODEL == "customuser.CustomUser":
1028
+ post_data.update(
1029
+ {
1030
+ "country": "testcountry",
1031
+ "attachment": SimpleUploadedFile("test.txt", b"Uploaded file"),
1032
+ }
1033
+ )
1034
+
1035
+ response = self.post(post_data, self.current_user.pk)
1267
1036
 
1268
1037
  # Should redirect back to index
1269
1038
  self.assertRedirects(response, reverse("wagtailusers_users:index"))
@@ -1278,19 +1047,24 @@ class TestUserEditView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
1278
1047
  self.assertIs(user.is_active, True)
1279
1048
 
1280
1049
  def test_editing_own_password_does_not_log_out(self):
1281
- response = self.post(
1282
- {
1283
- "username": "test@email.com",
1284
- "email": "test@email.com",
1285
- "first_name": "Edited Myself",
1286
- "last_name": "User",
1287
- "password1": "c0rrecth0rse",
1288
- "password2": "c0rrecth0rse",
1289
- "is_active": "on",
1290
- "is_superuser": "on",
1291
- },
1292
- self.current_user.pk,
1293
- )
1050
+ post_data = {
1051
+ "username": "test@email.com",
1052
+ "email": "test@email.com",
1053
+ "first_name": "Edited Myself",
1054
+ "last_name": "User",
1055
+ "password1": "c0rrecth0rse",
1056
+ "password2": "c0rrecth0rse",
1057
+ "is_active": "on",
1058
+ "is_superuser": "on",
1059
+ }
1060
+ if settings.AUTH_USER_MODEL == "customuser.CustomUser":
1061
+ post_data.update(
1062
+ {
1063
+ "country": "testcountry",
1064
+ "attachment": SimpleUploadedFile("test.txt", b"Uploaded file"),
1065
+ }
1066
+ )
1067
+ response = self.post(post_data, self.current_user.pk)
1294
1068
 
1295
1069
  # Should redirect back to index
1296
1070
  self.assertRedirects(response, reverse("wagtailusers_users:index"))
@@ -1307,21 +1081,27 @@ class TestUserEditView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
1307
1081
  """
1308
1082
  check that unsetting a user's own is_active or is_superuser flag has no effect
1309
1083
  """
1310
- response = self.post(
1311
- {
1312
- "username": "test@email.com",
1313
- "email": "test@email.com",
1314
- "first_name": "Edited Myself",
1315
- "last_name": "User",
1316
- # 'password1': "password",
1317
- # 'password2': "password",
1318
- # failing to submit is_active or is_superuser would unset those flags,
1319
- # if we didn't explicitly prevent that when editing self
1320
- # 'is_active': 'on',
1321
- # 'is_superuser': 'on',
1322
- },
1323
- self.current_user.pk,
1324
- )
1084
+ post_data = {
1085
+ "username": "test@email.com",
1086
+ "email": "test@email.com",
1087
+ "first_name": "Edited Myself",
1088
+ "last_name": "User",
1089
+ # 'password1': "password",
1090
+ # 'password2': "password",
1091
+ # failing to submit is_active or is_superuser would unset those flags,
1092
+ # if we didn't explicitly prevent that when editing self
1093
+ # 'is_active': 'on',
1094
+ # 'is_superuser': 'on',
1095
+ }
1096
+ if settings.AUTH_USER_MODEL == "customuser.CustomUser":
1097
+ post_data.update(
1098
+ {
1099
+ "country": "testcountry",
1100
+ "attachment": SimpleUploadedFile("test.txt", b"Uploaded file"),
1101
+ }
1102
+ )
1103
+
1104
+ response = self.post(post_data, self.current_user.pk)
1325
1105
 
1326
1106
  # Should redirect back to index
1327
1107
  self.assertRedirects(response, reverse("wagtailusers_users:index"))
@@ -1335,36 +1115,6 @@ class TestUserEditView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
1335
1115
  # Check that the user is still active
1336
1116
  self.assertIs(user.is_active, True)
1337
1117
 
1338
- @unittest.skipUnless(
1339
- settings.AUTH_USER_MODEL == "customuser.CustomUser",
1340
- "Only applicable to CustomUser",
1341
- )
1342
- @override_settings(
1343
- WAGTAIL_USER_EDIT_FORM="wagtail.users.tests.CustomUserEditForm",
1344
- )
1345
- def test_edit_with_custom_form(self):
1346
- response = self.post(
1347
- {
1348
- "username": "testuser",
1349
- "email": "test@user.com",
1350
- "first_name": "Edited",
1351
- "last_name": "User",
1352
- "password1": "password",
1353
- "password2": "password",
1354
- "country": "testcountry",
1355
- "attachment": SimpleUploadedFile("test.txt", b"Uploaded file"),
1356
- }
1357
- )
1358
-
1359
- # Should redirect back to index
1360
- self.assertRedirects(response, reverse("wagtailusers_users:index"))
1361
-
1362
- # Check that the user was edited
1363
- user = get_user_model().objects.get(pk=self.test_user.pk)
1364
- self.assertEqual(user.first_name, "Edited")
1365
- self.assertEqual(user.country, "testcountry")
1366
- self.assertEqual(user.attachment.read(), b"Uploaded file")
1367
-
1368
1118
  @unittest.skipIf(
1369
1119
  settings.AUTH_USER_MODEL == "emailuser.EmailUser", "Not applicable to EmailUser"
1370
1120
  )
@@ -1378,6 +1128,8 @@ class TestUserEditView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
1378
1128
  "last_name": "User",
1379
1129
  "password1": "password",
1380
1130
  "password2": "password",
1131
+ "country": "testcountry",
1132
+ "attachment": SimpleUploadedFile("test.txt", b"Uploaded file"),
1381
1133
  }
1382
1134
  )
1383
1135
 
@@ -1396,17 +1148,10 @@ class TestUserEditView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
1396
1148
  @override_settings(WAGTAILUSERS_PASSWORD_ENABLED=False)
1397
1149
  def test_password_fields_ignored_when_disabled(self):
1398
1150
  """When WAGTAILUSERS_PASSWORD_REQUIRED is False, existing password should be left unchanged"""
1399
- response = self.post(
1400
- {
1401
- "username": "testuser",
1402
- "email": "test@user.com",
1403
- "first_name": "Edited",
1404
- "last_name": "User",
1405
- "is_active": "on",
1406
- "password1": "banana", # not part of the form - should be ignored
1407
- "password2": "kumquat", # not part of the form - should be ignored
1408
- }
1409
- )
1151
+ post_data = self.post_data.copy()
1152
+ post_data["password1"] = "banana" # not part of the form - should be ignored
1153
+ post_data["password2"] = "kumquat" # not part of the form - should be ignored
1154
+ response = self.post(post_data)
1410
1155
 
1411
1156
  # Should redirect back to index
1412
1157
  self.assertRedirects(response, reverse("wagtailusers_users:index"))
@@ -1439,16 +1184,9 @@ class TestUserEditView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
1439
1184
  return HttpResponse("Overridden!")
1440
1185
 
1441
1186
  with self.register_hook("before_edit_user", hook_func):
1442
- post_data = {
1443
- "username": "testuser",
1444
- "email": "test@user.com",
1445
- "first_name": "Edited",
1446
- "last_name": "User",
1447
- "password1": "password",
1448
- "password2": "password",
1449
- }
1450
1187
  response = self.client.post(
1451
- reverse("wagtailusers_users:edit", args=(self.test_user.pk,)), post_data
1188
+ reverse("wagtailusers_users:edit", args=(self.test_user.pk,)),
1189
+ self.post_data,
1452
1190
  )
1453
1191
 
1454
1192
  self.assertEqual(response.status_code, 200)
@@ -1462,16 +1200,9 @@ class TestUserEditView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
1462
1200
  return HttpResponse("Overridden!")
1463
1201
 
1464
1202
  with self.register_hook("after_edit_user", hook_func):
1465
- post_data = {
1466
- "username": "testuser",
1467
- "email": "test@user.com",
1468
- "first_name": "Edited",
1469
- "last_name": "User",
1470
- "password1": "password",
1471
- "password2": "password",
1472
- }
1473
1203
  response = self.client.post(
1474
- reverse("wagtailusers_users:edit", args=(self.test_user.pk,)), post_data
1204
+ reverse("wagtailusers_users:edit", args=(self.test_user.pk,)),
1205
+ self.post_data,
1475
1206
  )
1476
1207
 
1477
1208
  self.assertEqual(response.status_code, 200)
@@ -1594,6 +1325,14 @@ class TestUserEditViewForNonSuperuser(WagtailTestUtils, TestCase):
1594
1325
  "is_superuser": "on",
1595
1326
  "is_active": "on",
1596
1327
  }
1328
+ if settings.AUTH_USER_MODEL == "customuser.CustomUser":
1329
+ post_data.update(
1330
+ {
1331
+ "country": "testcountry",
1332
+ "attachment": SimpleUploadedFile("test.txt", b"Uploaded file"),
1333
+ }
1334
+ )
1335
+
1597
1336
  response = self.client.post(
1598
1337
  reverse("wagtailusers_users:edit", args=(self.editor_user.pk,)), post_data
1599
1338
  )
@@ -2722,65 +2461,104 @@ class TestGroupHistoryView(WagtailTestUtils, TestCase):
2722
2461
 
2723
2462
 
2724
2463
  class TestGroupViewSet(TestCase):
2725
- app_config_attr = "group_viewset"
2726
- default_viewset_cls = GroupViewSet
2727
- custom_viewset_cls = CustomGroupViewSet
2728
- create_form_cls = CustomGroupForm
2729
- edit_form_cls = CustomGroupForm
2730
-
2731
2464
  def setUp(self):
2732
2465
  self.app_config = apps.get_app_config("wagtailusers")
2466
+ self.app_config_class_name = self.app_config.__class__.__name__
2733
2467
 
2734
2468
  def test_get_viewset_cls(self):
2735
2469
  self.assertIs(
2736
- get_viewset_cls(self.app_config, self.app_config_attr),
2737
- self.default_viewset_cls,
2470
+ get_viewset_cls(self.app_config, "group_viewset"),
2471
+ GroupViewSet,
2738
2472
  )
2739
2473
 
2740
2474
  def test_get_viewset_cls_with_custom_form(self):
2741
2475
  with unittest.mock.patch.object(
2742
2476
  self.app_config,
2743
- self.app_config_attr,
2744
- new=f"wagtail.users.tests.{self.custom_viewset_cls.__name__}",
2477
+ "group_viewset",
2478
+ new="wagtail.users.tests.CustomGroupViewSet",
2745
2479
  ):
2746
- group_viewset = get_viewset_cls(self.app_config, self.app_config_attr)
2747
- self.assertIs(group_viewset, self.custom_viewset_cls)
2480
+ group_viewset = get_viewset_cls(self.app_config, "group_viewset")
2481
+ self.assertIs(group_viewset, CustomGroupViewSet)
2748
2482
  self.assertEqual(group_viewset.icon, "custom-icon")
2749
2483
  viewset = group_viewset()
2750
- self.assertIs(viewset.get_form_class(for_update=False), self.create_form_cls)
2751
- self.assertIs(viewset.get_form_class(for_update=True), self.edit_form_cls)
2484
+ self.assertIs(viewset.get_form_class(for_update=False), CustomGroupForm)
2485
+ self.assertIs(viewset.get_form_class(for_update=True), CustomGroupForm)
2752
2486
 
2753
2487
  def test_get_viewset_cls_custom_form_invalid_value(self):
2754
2488
  with unittest.mock.patch.object(
2755
- self.app_config, self.app_config_attr, new="asdfasdf"
2489
+ self.app_config, "group_viewset", new="asdfasdf"
2756
2490
  ):
2757
2491
  with self.assertRaisesMessage(
2758
2492
  ImproperlyConfigured,
2759
- f"Invalid setting for WagtailUsersAppConfig.{self.app_config_attr}: "
2493
+ f"Invalid setting for {self.app_config_class_name}.group_viewset: "
2760
2494
  "asdfasdf doesn't look like a module path",
2761
2495
  ):
2762
- get_viewset_cls(self.app_config, self.app_config_attr)
2496
+ get_viewset_cls(self.app_config, "group_viewset")
2763
2497
 
2764
2498
  def test_get_viewset_cls_custom_form_does_not_exist(self):
2765
2499
  with unittest.mock.patch.object(
2766
2500
  self.app_config,
2767
- self.app_config_attr,
2501
+ "group_viewset",
2768
2502
  new="wagtail.users.tests.CustomClassDoesNotExist",
2769
2503
  ):
2770
2504
  with self.assertRaisesMessage(
2771
2505
  ImproperlyConfigured,
2772
- f"Invalid setting for WagtailUsersAppConfig.{self.app_config_attr}: "
2506
+ f"Invalid setting for {self.app_config_class_name}.group_viewset: "
2773
2507
  'Module "wagtail.users.tests" does not define a "CustomClassDoesNotExist" attribute/class',
2774
2508
  ):
2775
- get_viewset_cls(self.app_config, self.app_config_attr)
2509
+ get_viewset_cls(self.app_config, "group_viewset")
2510
+
2511
+
2512
+ class TestUserViewSet(TestCase):
2513
+ def setUp(self):
2514
+ self.app_config = apps.get_app_config("wagtailusers")
2515
+ self.app_config_class_name = self.app_config.__class__.__name__
2516
+
2517
+ @unittest.skipUnless(
2518
+ settings.AUTH_USER_MODEL == "emailuser.EmailUser",
2519
+ "Test only applies to EmailUser model",
2520
+ )
2521
+ def test_get_viewset_cls_default(self):
2522
+ self.assertIs(
2523
+ get_viewset_cls(self.app_config, "user_viewset"),
2524
+ UserViewSet,
2525
+ )
2526
+
2527
+ @unittest.skipUnless(
2528
+ settings.AUTH_USER_MODEL == "customuser.CustomUser",
2529
+ "Test only applies to CustomUser model",
2530
+ )
2531
+ def test_get_viewset_cls_custom(self):
2532
+ viewset_cls = get_viewset_cls(self.app_config, "user_viewset")
2533
+ self.assertIs(viewset_cls, CustomUserViewSet)
2534
+ self.assertEqual(viewset_cls.icon, "custom-icon")
2535
+ viewset = viewset_cls()
2536
+ self.assertIs(viewset.get_form_class(for_update=False), CustomUserCreationForm)
2537
+ self.assertIs(viewset.get_form_class(for_update=True), CustomUserEditForm)
2776
2538
 
2539
+ def test_get_viewset_cls_custom_form_invalid_value(self):
2540
+ with unittest.mock.patch.object(
2541
+ self.app_config, "user_viewset", new="asdfasdf"
2542
+ ):
2543
+ with self.assertRaisesMessage(
2544
+ ImproperlyConfigured,
2545
+ f"Invalid setting for {self.app_config_class_name}.user_viewset: "
2546
+ "asdfasdf doesn't look like a module path",
2547
+ ):
2548
+ get_viewset_cls(self.app_config, "user_viewset")
2777
2549
 
2778
- class TestUserViewSet(TestGroupViewSet):
2779
- app_config_attr = "user_viewset"
2780
- default_viewset_cls = UserViewSet
2781
- custom_viewset_cls = CustomUserViewSet
2782
- create_form_cls = CustomUserCreationForm
2783
- edit_form_cls = CustomUserEditForm
2550
+ def test_get_viewset_cls_custom_form_does_not_exist(self):
2551
+ with unittest.mock.patch.object(
2552
+ self.app_config,
2553
+ "user_viewset",
2554
+ new="wagtail.users.tests.CustomClassDoesNotExist",
2555
+ ):
2556
+ with self.assertRaisesMessage(
2557
+ ImproperlyConfigured,
2558
+ f"Invalid setting for {self.app_config_class_name}.user_viewset: "
2559
+ 'Module "wagtail.users.tests" does not define a "CustomClassDoesNotExist" attribute/class',
2560
+ ):
2561
+ get_viewset_cls(self.app_config, "user_viewset")
2784
2562
 
2785
2563
  def test_registered_permissions(self):
2786
2564
  group_ct = ContentType.objects.get_for_model(Group)
@@ -2831,6 +2609,21 @@ class TestAuthorisationCreateView(WagtailTestUtils, TestCase):
2831
2609
  self._user = self.create_user(username="auth_user", password="password")
2832
2610
  self._user.user_permissions.add(Permission.objects.get(codename="access_admin"))
2833
2611
  self.login(username="auth_user", password="password")
2612
+ self.post_data = {
2613
+ "username": "testuser",
2614
+ "email": "test@user.com",
2615
+ "first_name": "Test",
2616
+ "last_name": "User",
2617
+ "password1": "password",
2618
+ "password2": "password",
2619
+ }
2620
+ if settings.AUTH_USER_MODEL == "customuser.CustomUser":
2621
+ self.post_data.update(
2622
+ {
2623
+ "country": "testcountry",
2624
+ "attachment": SimpleUploadedFile("test.txt", b"Uploaded file"),
2625
+ }
2626
+ )
2834
2627
 
2835
2628
  def get(self, params={}):
2836
2629
  return self.client.get(reverse("wagtailusers_users:add"), params)
@@ -2862,16 +2655,7 @@ class TestAuthorisationCreateView(WagtailTestUtils, TestCase):
2862
2655
  self.assertTemplateUsed(response, "wagtailusers/users/create.html")
2863
2656
 
2864
2657
  def test_unauthorised_post(self):
2865
- response = self.post(
2866
- {
2867
- "username": "testuser",
2868
- "email": "test@user.com",
2869
- "first_name": "Test",
2870
- "last_name": "User",
2871
- "password1": "password",
2872
- "password2": "password",
2873
- }
2874
- )
2658
+ response = self.post(self.post_data)
2875
2659
  # Should redirect to admin index (permission denied)
2876
2660
  self.assertRedirects(response, reverse("wagtailadmin_home"))
2877
2661
  self.assertEqual(
@@ -2883,16 +2667,7 @@ class TestAuthorisationCreateView(WagtailTestUtils, TestCase):
2883
2667
 
2884
2668
  def test_authorised_post(self):
2885
2669
  self.gain_permissions()
2886
- response = self.post(
2887
- {
2888
- "username": "testuser",
2889
- "email": "test@user.com",
2890
- "first_name": "Test",
2891
- "last_name": "User",
2892
- "password1": "password",
2893
- "password2": "password",
2894
- }
2895
- )
2670
+ response = self.post(self.post_data)
2896
2671
  self.assertRedirects(response, reverse("wagtailusers_users:index"))
2897
2672
  user = get_user_model().objects.filter(email="test@user.com")
2898
2673
  self.assertTrue(user.exists())
@@ -2910,6 +2685,22 @@ class TestAuthorisationEditView(WagtailTestUtils, TestCase):
2910
2685
  last_name="User",
2911
2686
  password="password",
2912
2687
  )
2688
+ self.post_data = {
2689
+ "username": "testuser",
2690
+ "email": "test@user.com",
2691
+ "first_name": "Edited",
2692
+ "last_name": "User",
2693
+ "password1": "newpassword",
2694
+ "password2": "newpassword",
2695
+ "is_active": "on",
2696
+ }
2697
+ if settings.AUTH_USER_MODEL == "customuser.CustomUser":
2698
+ self.post_data.update(
2699
+ {
2700
+ "country": "testcountry",
2701
+ "attachment": SimpleUploadedFile("test.txt", b"Uploaded file"),
2702
+ }
2703
+ )
2913
2704
 
2914
2705
  def get(self, params={}, user_id=None):
2915
2706
  return self.client.get(
@@ -2947,17 +2738,7 @@ class TestAuthorisationEditView(WagtailTestUtils, TestCase):
2947
2738
  self.assertTemplateUsed(response, "wagtailusers/users/edit.html")
2948
2739
 
2949
2740
  def test_unauthorised_post(self):
2950
- response = self.post(
2951
- {
2952
- "username": "testuser",
2953
- "email": "test@user.com",
2954
- "first_name": "Edited",
2955
- "last_name": "User",
2956
- "password1": "newpassword",
2957
- "password2": "newpassword",
2958
- "is_active": "on",
2959
- }
2960
- )
2741
+ response = self.post(self.post_data)
2961
2742
  # Should redirect to admin index (permission denied)
2962
2743
  self.assertRedirects(response, reverse("wagtailadmin_home"))
2963
2744
  self.assertEqual(
@@ -2970,17 +2751,7 @@ class TestAuthorisationEditView(WagtailTestUtils, TestCase):
2970
2751
 
2971
2752
  def test_authorised_post(self):
2972
2753
  self.gain_permissions()
2973
- response = self.post(
2974
- {
2975
- "username": "testuser",
2976
- "email": "test@user.com",
2977
- "first_name": "Edited",
2978
- "last_name": "User",
2979
- "password1": "newpassword",
2980
- "password2": "newpassword",
2981
- "is_active": "on",
2982
- }
2983
- )
2754
+ response = self.post(self.post_data)
2984
2755
  self.assertRedirects(response, reverse("wagtailusers_users:index"))
2985
2756
  user = get_user_model().objects.get(pk=self.test_user.pk)
2986
2757
  self.assertEqual(user.first_name, "Edited")
@@ -3050,103 +2821,6 @@ class TestAuthorisationDeleteView(WagtailTestUtils, TestCase):
3050
2821
  self.assertFalse(user.exists())
3051
2822
 
3052
2823
 
3053
- class TestTemplateTags(WagtailTestUtils, TestCase):
3054
- @classmethod
3055
- def setUpTestData(cls):
3056
- cls.user = cls.create_superuser("admin")
3057
- cls.request = get_dummy_request()
3058
- cls.request.user = cls.user
3059
- cls.test_user = cls.create_user(
3060
- username="testuser",
3061
- email="testuser@email.com",
3062
- password="password",
3063
- )
3064
-
3065
- def test_user_listing_buttons(self):
3066
- template = """
3067
- {% load wagtailusers_tags %}
3068
- {% for user in users %}
3069
- <ul class="actions">
3070
- {% user_listing_buttons user %}
3071
- </ul>
3072
- {% endfor %}
3073
- """
3074
-
3075
- def hook(user, request_user):
3076
- self.assertEqual(user, self.test_user)
3077
- self.assertEqual(request_user, self.user)
3078
- yield UserListingButton(
3079
- "Show profile",
3080
- f"/goes/to/a/url/{user.pk}",
3081
- priority=30,
3082
- )
3083
-
3084
- with self.register_hook("register_user_listing_buttons", hook):
3085
- with self.assertWarnsMessage(
3086
- RemovedInWagtail70Warning,
3087
- "`user_listing_buttons` template tag is deprecated.",
3088
- ):
3089
- html = Template(template).render(
3090
- RequestContext(self.request, {"users": [self.test_user]})
3091
- )
3092
-
3093
- soup = self.get_soup(html)
3094
-
3095
- profile_url = f"/goes/to/a/url/{self.test_user.pk}"
3096
- top_level_custom_button = soup.select_one(f"li > a[href='{profile_url}']")
3097
- self.assertIsNotNone(top_level_custom_button)
3098
- self.assertEqual(
3099
- top_level_custom_button.text.strip(),
3100
- "Show profile",
3101
- )
3102
-
3103
- def test_user_listing_buttons_with_deprecated_hook(self):
3104
- template = """
3105
- {% load wagtailusers_tags %}
3106
- {% for user in users %}
3107
- <ul class="actions">
3108
- {% user_listing_buttons user %}
3109
- </ul>
3110
- {% endfor %}
3111
- """
3112
-
3113
- def deprecated_hook(context, user):
3114
- self.assertEqual(user, self.test_user)
3115
- self.assertEqual(context.request.user, self.user)
3116
- yield UserListingButton(
3117
- "Show profile",
3118
- f"/goes/to/a/url/{user.pk}",
3119
- priority=30,
3120
- )
3121
-
3122
- with self.register_hook("register_user_listing_buttons", deprecated_hook):
3123
- with self.assertWarns(RemovedInWagtail70Warning) as warning_manager:
3124
- html = Template(template).render(
3125
- RequestContext(self.request, {"users": [self.test_user]})
3126
- )
3127
-
3128
- self.assertEqual(
3129
- [str(w.message) for w in warning_manager.warnings],
3130
- [
3131
- # Deprecation of the template tag
3132
- "`user_listing_buttons` template tag is deprecated.",
3133
- # Deprecation of the hook signature
3134
- "`register_user_listing_buttons` hook functions should accept a "
3135
- "`request_user` argument instead of `context` - "
3136
- "wagtail.users.tests.test_admin_views.deprecated_hook needs to be updated",
3137
- ],
3138
- )
3139
-
3140
- soup = self.get_soup(html)
3141
- profile_url = f"/goes/to/a/url/{self.test_user.pk}"
3142
- top_level_custom_button = soup.select_one(f"li > a[href='{profile_url}']")
3143
- self.assertIsNotNone(top_level_custom_button)
3144
- self.assertEqual(
3145
- top_level_custom_button.text.strip(),
3146
- "Show profile",
3147
- )
3148
-
3149
-
3150
2824
  class TestAdminPermissions(WagtailTestUtils, TestCase):
3151
2825
  def test_registered_user_permissions(self):
3152
2826
  user_ct = ContentType.objects.get_for_model(User)