Wrapped func with sync_to_async

This commit is contained in:
enrico 2022-09-20 12:07:18 -04:00
parent ec1d7547fd
commit de6df46a81

View File

@ -564,7 +564,7 @@ class APIView(View):
if getattr(self, 'view_is_async', False):
async def handler():
return func()
return await sync_to_async(func)()
else:
def handler():
return func()