Browse Source

Fix for loop on get_value_or_default function

pull/5075/head
svd0 3 years ago
parent
commit
2737b76132
  1. 2
      fastapi/utils.py

2
fastapi/utils.py

@ -168,7 +168,7 @@ def get_value_or_default(
Otherwise, the first item (a `DefaultPlaceholder`) will be returned.
"""
items = (first_item,) + extra_items
for item in (first_item,) + items:
for item in items:
if not isinstance(item, DefaultPlaceholder):
return item
return first_item

Loading…
Cancel
Save