From e45a1e7e394b7bf14d7f15f7befad836eac3dcc0 Mon Sep 17 00:00:00 2001 From: Ashley Wright Date: Thu, 28 Nov 2024 14:21:47 -0800 Subject: [PATCH] Fix divide be 0 error --- validator/weight_setting/benchmarking_api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/validator/weight_setting/benchmarking_api.py b/validator/weight_setting/benchmarking_api.py index c91e9b3f..2a4c75df 100644 --- a/validator/weight_setting/benchmarking_api.py +++ b/validator/weight_setting/benchmarking_api.py @@ -105,7 +105,9 @@ def send_submissions_to_api(version: str, all_apis: list[BenchmarkingApi], submi contest_api_assignment[lowest_contest_id].append(api) for contest_id, apis in contest_api_assignment.items(): - if contest_id not in submissions_by_contest and contest_id in ACTIVE_CONTESTS: + if not contest_id in ACTIVE_CONTESTS: + continue + if contest_id not in submissions_by_contest: raise RuntimeError(f"No API compatible with contest type {contest_id.name}") contest_submissions = submissions_by_contest[contest_id]