Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix time zone activation leaking into subsequent requests in require_…
…admin_access() 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.
- Loading branch information