functools.wraps to help investigate #1517

This commit is contained in:
Simon Willison 2021-11-18 19:19:43 -08:00
commit 3025505515

View file

@ -2,6 +2,7 @@ import asyncio
import asgi_csrf import asgi_csrf
import collections import collections
import datetime import datetime
import functools
import glob import glob
import hashlib import hashlib
import httpx import httpx
@ -1354,6 +1355,7 @@ def _cleaner_task_str(task):
def wrap_view(view_fn, datasette): def wrap_view(view_fn, datasette):
@functools.wraps(view_fn)
async def async_view_fn(request, send): async def async_view_fn(request, send):
if inspect.iscoroutinefunction(view_fn): if inspect.iscoroutinefunction(view_fn):
response = await async_call_with_supported_arguments( response = await async_call_with_supported_arguments(