summaryrefslogtreecommitdiff
path: root/jfr_playoff/data.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2018-01-27 15:22:23 +0100
committeremkael <emkael@tlen.pl>2018-01-27 15:22:23 +0100
commit3113c57b54474d5a0a71c83c4c46813d6a26759a (patch)
treedd2eb720944751c6b243e79e7a760a282c8f9e2d /jfr_playoff/data.py
parent69e4fe2f9925a71b6b3aa86c2ae8173091f9dad3 (diff)
Score defined in JSON overrides any score from database
Closes #3
Diffstat (limited to 'jfr_playoff/data.py')
-rw-r--r--jfr_playoff/data.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/jfr_playoff/data.py b/jfr_playoff/data.py
index 6a58ee6..cb45fc3 100644
--- a/jfr_playoff/data.py
+++ b/jfr_playoff/data.py
@@ -143,9 +143,6 @@ class PlayoffData(object):
else '??' for team in match_teams])
else:
teams[i].name = ''
- if 'score' in match:
- for i in range(0, 2):
- teams[i].score = match['score'][i]
return teams
def get_match_info(self, match):
@@ -166,8 +163,10 @@ class PlayoffData(object):
info.teams = self.get_db_match_teams(match)
except (mysql.connector.Error, TypeError, IndexError):
info.teams = self.get_config_match_teams(match)
- if (info.teams[0].score != 0) or (info.teams[1].score != 0):
- info.running = -1
+ if 'score' in match:
+ for i in range(0, 2):
+ info.teams[i].score = match['score'][i]
+ info.running = -1
try:
towels = self.database.fetch(
match['database'], p_sql.TOWEL_COUNT,