mirror of https://github.com/tiangolo/fastapi.git
♻ Simplify conditional assignment in `fastapi/dependencies/utils.py` (#4597)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
parent
75792eb82b
commit
c8124496fc
|
|
@ -302,10 +302,7 @@ def get_dependant(
|
||||||
assert is_scalar_field(
|
assert is_scalar_field(
|
||||||
field=param_field
|
field=param_field
|
||||||
), "Path params must be of one of the supported types"
|
), "Path params must be of one of the supported types"
|
||||||
if isinstance(param.default, params.Path):
|
ignore_default = not isinstance(param.default, params.Path)
|
||||||
ignore_default = False
|
|
||||||
else:
|
|
||||||
ignore_default = True
|
|
||||||
param_field = get_param_field(
|
param_field = get_param_field(
|
||||||
param=param,
|
param=param,
|
||||||
param_name=param_name,
|
param_name=param_name,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue