Skip to content

Commit 1e5adc7

Browse files
author
Jens Kürten
committed
fix: Ensure single items of target type are appended in get_items_of_type function
1 parent d5003d5 commit 1e5adc7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

csfunctions/util.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ def get_items_of_type(model: BaseModel, target_type: type[T]) -> list[T]:
2626
for item in attr:
2727
if isinstance(item, target_type):
2828
items.append(item)
29+
elif isinstance(attr, target_type):
30+
items.append(attr)
2931
return items

0 commit comments

Comments
 (0)