Skip to content

Commit 3739abf

Browse files
add asynccontextmanager to run_fastui_form
1 parent 12a75e1 commit 3739abf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/python-fastui/fastui/forms.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import json
22
import typing as _t
3+
from contextlib import asynccontextmanager
34
from itertools import groupby
45
from mimetypes import MimeTypes
56
from operator import itemgetter
@@ -34,6 +35,7 @@ def __class_getitem__(cls, model: _t.Type[FormModel]) -> fastapi_params.Depends:
3435

3536

3637
def fastui_form(model: _t.Type[FormModel]) -> fastapi_params.Depends:
38+
@asynccontextmanager
3739
async def run_fastui_form(request: fastapi.Request):
3840
async with request.form() as form_data:
3941
model_data = unflatten(form_data)

0 commit comments

Comments
 (0)