-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compatibility with third-party sync-only middleware (#19)
- Loading branch information
1 parent
04c20ac
commit a486fe9
Showing
9 changed files
with
75 additions
and
85 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,5 @@ jobs: | |
git config user.email [email protected] | ||
cd docs | ||
mike deploy --push develop | ||
concurrency: | ||
group: publish-docs |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,5 @@ jobs: | |
git config user.email [email protected] | ||
cd docs | ||
mike deploy --push --update-aliases ${{ github.event.release.name }} latest | ||
concurrency: | ||
group: publish-docs |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,4 @@ bakhit | |
sublicense | ||
middleware | ||
unhashed | ||
async |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from asgiref.sync import iscoroutinefunction | ||
from django.utils.decorators import async_only_middleware, sync_only_middleware | ||
|
||
|
||
@sync_only_middleware | ||
def sync_middleware_1(get_response): | ||
def middleware(request): | ||
response = get_response(request) | ||
return response | ||
|
||
return middleware | ||
|
||
|
||
@async_only_middleware | ||
def async_middleware_1(get_response): | ||
async def middleware(request): | ||
response = await get_response(request) | ||
return response | ||
|
||
return middleware | ||
|
||
|
||
@sync_only_middleware | ||
def sync_middleware_2(get_response): | ||
def middleware(request): | ||
response = get_response(request) | ||
return response | ||
|
||
return middleware | ||
|
||
|
||
@async_only_middleware | ||
def async_middleware_2(get_response): | ||
async def middleware(request): | ||
response = await get_response(request) | ||
return response | ||
|
||
return middleware |