From b07c2f2a90194a0c7b304fafa63fdc45ca577d0d Mon Sep 17 00:00:00 2001 From: Erik Vroon Date: Thu, 21 Nov 2024 19:49:29 +0100 Subject: [PATCH] fixup! fixup! fixup! Swiss scheduling improvements --- backend/bracket/logic/scheduling/ladder_teams.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/bracket/logic/scheduling/ladder_teams.py b/backend/bracket/logic/scheduling/ladder_teams.py index d099aada1..5f92da07e 100644 --- a/backend/bracket/logic/scheduling/ladder_teams.py +++ b/backend/bracket/logic/scheduling/ladder_teams.py @@ -9,7 +9,7 @@ SuggestedMatch, get_match_hash, ) -from bracket.models.db.stage_item_inputs import StageItemInput +from bracket.models.db.stage_item_inputs import StageItemInput, StageItemInputFinal from bracket.models.db.util import RoundWithMatches from bracket.utils.id_types import StageItemInputId from bracket.utils.types import assert_some @@ -65,7 +65,10 @@ def get_possible_upcoming_matches_for_swiss( draft_round_input_ids = get_draft_round_input_ids(draft_round) if draft_round else frozenset() inputs_to_schedule = [ - input_ for input_ in stage_item_inputs if input_.id not in draft_round_input_ids + input_ + for input_ in stage_item_inputs + if input_.id not in draft_round_input_ids + and (not isinstance(input_, StageItemInputFinal) or input_.team.active) ] if len(inputs_to_schedule) < 1: