* Convert images index to a class-based view
* Use TemplateView for images index
* Add a separate URL endpoint for image search results include
Eliminates use of request.is_ajax, along with some unnecessary collection querying
* Convert snippet list view to a class-based view
* Convert ListView to use TemplateView
* Add separate URL endpoint for listing results include
This eliminates the use of request.is_ajax, which will be removed in Django 4.0.
* Use a results_only parameter on ListView rather than distinct subclasses
* Add UUID primary key to EmailUser
* Convert pks to strings when being used as dictionary keys for commenting, to prevent custom primary key fields on user model causing serialization to fail
The use of Page.objects.in_bulk to retrieve all page data for the panel in a single query was being thwarted by our use of revision.page.id when reading them back (which ends up loading the whole page object just to look at the id...)
Introduce a WAGTAIL_WORKFLOW_ENABLED setting; when false, the workflow report and settings menus are hidden, permissions are not registered, moderation-related dashboard panels on the homepage are skipped, workflow actions on add/edit page are hidden, and model methods such as page.current_workflow_state return None / False immediately without any db queries.
* Reorganise snippet admin URLs to avoid ambiguous paths
Snippet admin views allow for arbitrary strings as primary keys, and the current URL patterns don't adequately namespace these from reserved words like 'add' - for example, a snippet with the primary key 'add' would have an edit URL that collides with the add view at `/admin/snippets/foo/bar/add/`.
This is unlikely to come up in practice, but it does mean that our urlconf is more sensitive to ordering than it needs to be. Rearrange so that the verb (add, edit, delete) consistently comes before the pk, and add redirects to handle the legacy URLs.
* Release notes for #7208
Co-authored-by: Storm Heg <storm@stormheg.co>
* Add ability to register multiple hooks with register_temporarily
It's not possible to add multiple items in a ``with`` block in multiple
lines. So to register multiple hooks, you either need to put them all on
one line or add many nested ``with`` blocks.
This commit adds the ability to pass in a list of hooks into one call.
This works around the syntax error, but there's still no way to
represent this in a way that flake8 is happy with so I've added
``#noqa`` in a few places.
* Telepath set up for new sidebar
* unindent hooks.register_temporarily with blocks
Co-authored-by: Matt Westcott <matt@west.co.tt>
* Update wagtail/core/telepath.py
Co-authored-by: Matt Westcott <matt@west.co.tt>
Co-authored-by: Matt Westcott <matt@west.co.tt>