summaryrefslogtreecommitdiff
path: root/jfr_playoff/data/info.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2023-02-12 15:31:29 +0100
committeremkael <emkael@tlen.pl>2023-02-12 15:31:29 +0100
commit7cc52b5a1978efedc62729145db12cb8a3efb447 (patch)
treec57f601c0736cc6420f7d057fd5f10a12c694ec9 /jfr_playoff/data/info.py
parentade973c25ca403c5385983f42fbf60c906e25b9b (diff)
Do not allow resolving pre-selected teams if there are yet unknown teams
Diffstat (limited to 'jfr_playoff/data/info.py')
-rw-r--r--jfr_playoff/data/info.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/jfr_playoff/data/info.py b/jfr_playoff/data/info.py
index b7e7935..557a264 100644
--- a/jfr_playoff/data/info.py
+++ b/jfr_playoff/data/info.py
@@ -209,8 +209,11 @@ class MatchInfo(ResultInfo):
match_teams = [None] * len(placed_teams)
teams[i].name = match_teams
teams[i].possible_name = possible_teams
- teams[i].selected_team = self.config['selected_teams'][i] \
- if 'selected_teams' in self.config else -1
+ teams[i].unknown_teams = len([team for team in match_teams if team is None])
+ teams[i].selected_team = -1
+ if 'selected_teams' in self.config \
+ and not teams[i].unknown_teams:
+ teams[i].selected_team = self.config['selected_teams'][i]
teams[i].known_teams = 1 if teams[i].selected_team >= 0 else len([
team for team in match_teams if team is not None])
PlayoffLogger.get('matchinfo').info(