(20241226) Bug fixed when Zerodha's instruments are asked from an expired key.

This commit is contained in:
2024-12-26 14:42:28 +05:30
parent c967075521
commit a26bb2e85f
@@ -193,8 +193,9 @@ 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:
if symbol_list.data:
symbol_list.data = [s.model_dump() for s in symbol_list.data]
for d in symbol_list.data:
expiry_ts = d["expiryTs"]
if isinstance(expiry_ts, datetime.datetime):
d["expiryTs"] = expiry_ts.timestamp()
@@ -203,7 +204,7 @@ async def request_oauth_authorization_url(
return ResponseModel(
status_code = StatusCodes.OK if symbol_list.success else StatusCodes.FAILED,
http_code = HttpCodes.SUCCESS if symbol_list.success else HttpCodes.INTERNAL_SERVER_ERROR,
data = data,
data = symbol_list.data,
message = symbol_list.message
)