(20241226) Bug fixed when Zerodha's instruments are asked from an expired key.
This commit is contained in:
@@ -193,17 +193,18 @@ async def request_oauth_authorization_url(
|
|||||||
# ┛
|
# ┛
|
||||||
|
|
||||||
# Handle time data:
|
# Handle time data:
|
||||||
data = [s.model_dump() for s in symbol_list.data] if symbol_list.data is not None else symbol_list.data
|
if symbol_list.data:
|
||||||
for d in data:
|
symbol_list.data = [s.model_dump() for s in symbol_list.data]
|
||||||
expiry_ts = d["expiryTs"]
|
for d in symbol_list.data:
|
||||||
if isinstance(expiry_ts, datetime.datetime):
|
expiry_ts = d["expiryTs"]
|
||||||
d["expiryTs"] = expiry_ts.timestamp()
|
if isinstance(expiry_ts, datetime.datetime):
|
||||||
|
d["expiryTs"] = expiry_ts.timestamp()
|
||||||
|
|
||||||
# Done here:
|
# Done here:
|
||||||
return ResponseModel(
|
return ResponseModel(
|
||||||
status_code = StatusCodes.OK if symbol_list.success else StatusCodes.FAILED,
|
status_code = StatusCodes.OK if symbol_list.success else StatusCodes.FAILED,
|
||||||
http_code = HttpCodes.SUCCESS if symbol_list.success else HttpCodes.INTERNAL_SERVER_ERROR,
|
http_code = HttpCodes.SUCCESS if symbol_list.success else HttpCodes.INTERNAL_SERVER_ERROR,
|
||||||
data = data,
|
data = symbol_list.data,
|
||||||
message = symbol_list.message
|
message = symbol_list.message
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user