- Introduce a new controller `MessagesController` to contain the dynamic updating of messages
- Ensure the document updated label does not repeat every time a document is updated
- Using the Stimulus controller with templates approach, icons can easily be pre-loaded for each message type
- Ensure that messages are consistently cleared when new ones are added (this was done ad-hoc across some usage and not others)
- Fixes #9493
The timezone of an admin user was only activated, but never deactivated,
so it leaks into following requests of the current thread.
For example, this affected tests executed AFTER
wagtail.admin.tests.test_account_management (see #9628).
This commit changes the timezone activation to use the override()
context manager from django.utils.timezone, which calls deactivate()
when the context manager is closed.
This is similar to how we use the override() from
django.utils.translation for locale activation in the same decorator.
Either of block_errors or non_block_errors can be omitted; non_block_errors can be passed as a plain list rather than an ErrorList; and the values in block_errors can be ValidationError instances or singleton lists, not just singleton ErrorLists.
Refactor it to allow either of block_errors or non_block_errors to be omitted; allow non_block_errors to be passed as a plain list rather than an ErrorList; and allow the items of block_errors to be ValidationError instances or singleton lists rather than just singleton ErrorLists.
This allows us to use the function in modules that are imported by wagtailadmin_tags (either directly or indirectly) without triggering a circular import.
- The status tag styles did not actually change when the permissions changed
- Instead of trying to treat the status tag as a button, use an actual button styling as this pattern is not used anywhere else in Wagtail
- Fixes #10128
* Adding missing return statement to FormPage.process_form_submission in the "Custom form submission model" example to make it available to FormPage.render_landing_page, among other methods.
All setError methods now accept an instance of the error dict returned by get_error_json_data. Since this is consistent across all ValidationError subclasses, there is no longer any need for the exception type to match the block type (unless you care about propagating child block errors).
Fixes #5663