From 2e90bc1de4f2b2ab9948472c00bf104e951da466 Mon Sep 17 00:00:00 2001 From: pharr117 Date: Mon, 11 Sep 2023 20:27:05 -0400 Subject: [PATCH] Cast plan height to int if available --- app.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 57e8554..32a0726 100644 --- a/app.py +++ b/app.py @@ -594,9 +594,15 @@ def fetch_data_for_network(network, network_type, repo_path): print(f"Failed to parse binaries for network {network}. Non-fatal error, skipping...") pass + plan_height = upgrade_plan.get("height", -1) + try: + plan_height = int(plan_height) + except ValueError: + plan_height = -1 + # Include the expanded information in the output data output_data["upgrade_plan"] = { - "height": upgrade_plan.get("height", None), + "height": plan_height, "binaries": binaries, "name": upgrade_plan.get("name", None), "upgraded_client_state": upgrade_plan.get("upgraded_client_state", None),