mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-27 00:19:53 +03:00
Wrapped func with sync_to_async
This commit is contained in:
parent
ec1d7547fd
commit
de6df46a81
|
@ -564,7 +564,7 @@ class APIView(View):
|
||||||
|
|
||||||
if getattr(self, 'view_is_async', False):
|
if getattr(self, 'view_is_async', False):
|
||||||
async def handler():
|
async def handler():
|
||||||
return func()
|
return await sync_to_async(func)()
|
||||||
else:
|
else:
|
||||||
def handler():
|
def handler():
|
||||||
return func()
|
return func()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user