diff --git a/fastapi/dependencies/utils.py b/fastapi/dependencies/utils.py index f12e0b37c2..ca3184ec36 100644 --- a/fastapi/dependencies/utils.py +++ b/fastapi/dependencies/utils.py @@ -145,7 +145,11 @@ def get_flat_dependant( if visited is None: visited = set() visited.add(dependant.cache_key) - if parent_oauth_scopes or dependant.parent_oauth_scopes or dependant.own_oauth_scopes: + if ( + parent_oauth_scopes + or dependant.parent_oauth_scopes + or dependant.own_oauth_scopes + ): use_parent_oauth_scopes = (parent_oauth_scopes or []) + ( dependant.oauth_scopes or [] )