Skip to content

Commit faa138e

Browse files
committed
Update utils.py
1 parent 1876bbc commit faa138e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/api/v1/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ def sanitize_for_json(obj: Any) -> Any:
1919
return obj.isoformat()
2020
elif hasattr(obj, "__dict__"): # Handle objects with __dict__
2121
return sanitize_for_json(obj.__dict__)
22+
elif isinstance(obj, bool): # Handle boolean objects (before float conversion)
23+
return obj
2224
# Handle Decimal objects from database
2325
elif hasattr(obj, "__float__"):
2426
return float(obj)

0 commit comments

Comments
 (0)