From 1420c5adc80db7da21d563d7fe023f88ff84e286 Mon Sep 17 00:00:00 2001 From: cikay Date: Fri, 18 Feb 2022 15:41:30 +0300 Subject: [PATCH] Remove redundant conditions --- fastapi/dependencies/utils.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fastapi/dependencies/utils.py b/fastapi/dependencies/utils.py index d4028d067b882..ae88984448add 100644 --- a/fastapi/dependencies/utils.py +++ b/fastapi/dependencies/utils.py @@ -294,10 +294,7 @@ def get_dependant( assert is_scalar_field( field=param_field ), "Path params must be of one of the supported types" - if isinstance(param.default, params.Path): - ignore_default = False - else: - ignore_default = True + ignore_default = not isinstance(param.default, params.Path) param_field = get_param_field( param=param, param_name=param_name,