Browse Source

Lint fixes

pull/14582/head
johnslavik 7 months ago
parent
commit
7038358580
Failed to extract signature
  1. 4
      fastapi/routing.py

4
fastapi/routing.py

@ -153,7 +153,7 @@ def _prepare_response_content(
exclude_none: bool = False,
) -> Any:
if isinstance(res, BaseModel):
read_with_orm_mode = getattr(_get_model_config(res), "read_with_orm_mode", None) # type: ignore[arg-type]
read_with_orm_mode = getattr(_get_model_config(res), "read_with_orm_mode", None)
if read_with_orm_mode:
# Let from_orm extract the data from this model instead of converting
# it now to a dict.
@ -161,7 +161,7 @@ def _prepare_response_content(
# access instead of dict iteration, e.g. lazy relationships.
return res
return _model_dump(
res, # type: ignore[arg-type]
res,
by_alias=True,
exclude_unset=exclude_unset,
exclude_defaults=exclude_defaults,

Loading…
Cancel
Save