mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
functools.wraps to help investigate #1517
This commit is contained in:
parent
6e971b4ac1
commit
3025505515
1 changed files with 2 additions and 0 deletions
|
|
@ -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(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue