(20241226) Timestamp handling bug fixed for instruments that don't have any expiry.

This commit is contained in:
2024-12-26 14:36:48 +05:30
parent bfd02bf74a
commit c967075521
@@ -25,8 +25,7 @@
N/A
"""
import datetime
# *****************************************************************************************************************
# ***** ****
# *** IMPORT ***
@@ -195,7 +194,10 @@ async def request_oauth_authorization_url(
# Handle time data:
data = [s.model_dump() for s in symbol_list.data] if symbol_list.data is not None else symbol_list.data
for d in data: d["expiryTs"] = d["expiryTs"].timestamp()
for d in data:
expiry_ts = d["expiryTs"]
if isinstance(expiry_ts, datetime.datetime):
d["expiryTs"] = expiry_ts.timestamp()
# Done here:
return ResponseModel(