From cbc735e6aeca8d2545b8529c236f04120fa2cb2d Mon Sep 17 00:00:00 2001 From: ross-spencer Date: Tue, 19 Nov 2024 15:47:39 +0100 Subject: [PATCH] Ensure data is converted to dict This makes sure we can check foro null. --- src/itn_api/api.py | 1 + src/itn_api/htm_helpers.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/itn_api/api.py b/src/itn_api/api.py index 08b003d..9e80fd6 100644 --- a/src/itn_api/api.py +++ b/src/itn_api/api.py @@ -218,6 +218,7 @@ async def get_online_collectors() -> str: ) except apsw.SQLError: return "zero collectors online" + participants_count_total = dict(participants_count_total) htmx = htm_helpers.participants_count_table(participants_count_total) return htmx.strip() diff --git a/src/itn_api/htm_helpers.py b/src/itn_api/htm_helpers.py index 6b5ad7f..f2122e2 100644 --- a/src/itn_api/htm_helpers.py +++ b/src/itn_api/htm_helpers.py @@ -70,7 +70,7 @@ def participants_count_table(participants_count_total): """.strip() rows = "" - for stake_key, count in participants_count_total: + for stake_key, count in participants_count_total.items(): row = f""" {stake_key}