-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Propagated and restored contextvars in async_to_sync (#171)
sync_to_async already makes sure that contextvars are properly propagated, but async_to_sync does not. In Django 3.1, this fixes the behavior of got_request_exception which would otherwise be called in a different context than before_request or after_request under the following circumstances: 1. An ASGI request has been made 2. There is at least one sync middleware
- Loading branch information
Showing
2 changed files
with
64 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters