Browse Source

♻️ Use `dependant.is_coroutine_callable` to re-use unwrap logic in dependencies

pull/14434/head
Sebastián Ramírez 8 months ago
parent
commit
4923205424
  1. 2
      fastapi/routing.py

2
fastapi/routing.py

@ -308,7 +308,7 @@ def get_request_handler(
embed_body_fields: bool = False,
) -> Callable[[Request], Coroutine[Any, Any, Response]]:
assert dependant.call is not None, "dependant.call must be a function"
is_coroutine = iscoroutinefunction(dependant.call)
is_coroutine = dependant.is_coroutine_callable
is_body_form = body_field and isinstance(
body_field.field_info, (params.Form, temp_pydantic_v1_params.Form)
)

Loading…
Cancel
Save