summaryrefslogtreecommitdiff
path: root/jfr_playoff/data.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2018-02-21 14:09:05 +0100
committeremkael <emkael@tlen.pl>2018-02-21 14:09:05 +0100
commitccc54fde2f8c9301962e9c6f464d5f2eacd5506a (patch)
tree21a2f05ea664065d1aa98a3c69d58d6c14afdf59 /jfr_playoff/data.py
parent415748f29a6b3048bef08703a93c4f441f67d1eb (diff)
Not rendering phase/match links if they're not set
Fixes #13
Diffstat (limited to 'jfr_playoff/data.py')
-rw-r--r--jfr_playoff/data.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/jfr_playoff/data.py b/jfr_playoff/data.py
index 7f29bb2..c588610 100644
--- a/jfr_playoff/data.py
+++ b/jfr_playoff/data.py
@@ -36,7 +36,7 @@ class PlayoffData(object):
phase_count += len(phase['dummies'])
phase_object = Phase()
phase_object.title = phase['title']
- phase_object.link = phase['link']
+ phase_object.link = phase['link'] if 'link' in phase else None
phase_object.matches = [None] * phase_count
phase_pos = 0
for match in phase['matches']:
@@ -53,7 +53,8 @@ class PlayoffData(object):
for phase in self.phases:
for match in phase['matches']:
match_info = MatchInfo(match, self.teams, self.database)
- match_info.set_phase_link(phase['link'])
+ if 'link' in phase:
+ match_info.set_phase_link(phase['link'])
self.match_info[match['id']] = match_info.get_info()
if self.match_info[match['id']].running > 0:
for phase_obj in self.grid: