summaryrefslogtreecommitdiff
path: root/jfr_playoff
diff options
context:
space:
mode:
Diffstat (limited to 'jfr_playoff')
-rw-r--r--jfr_playoff/data/info.py2
-rw-r--r--jfr_playoff/dto.py4
2 files changed, 5 insertions, 1 deletions
diff --git a/jfr_playoff/data/info.py b/jfr_playoff/data/info.py
index 6e6f36c..b7e7935 100644
--- a/jfr_playoff/data/info.py
+++ b/jfr_playoff/data/info.py
@@ -268,7 +268,7 @@ class MatchInfo(ResultInfo):
if (self.info.teams[0].known_teams == 1) \
and (self.info.teams[1].known_teams == 1):
teams = [
- team.name[max(0, team.selected_team)]
+ team.selected_name
for team in self.info.teams
]
if self.info.running == -1:
diff --git a/jfr_playoff/dto.py b/jfr_playoff/dto.py
index 28aa446..cc7f618 100644
--- a/jfr_playoff/dto.py
+++ b/jfr_playoff/dto.py
@@ -25,6 +25,10 @@ class Team(object):
carry_over = floor(10 * self.score) / 10.0
return carry_over
+ @property
+ def selected_name(self):
+ return self.name[min(max(0, self.selected_team), len(self.name)-1)]
+
def __init__(self):
self.place = []
self.name = []