summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--f1elo/interface.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/f1elo/interface.py b/f1elo/interface.py
index a492bba..79311ba 100644
--- a/f1elo/interface.py
+++ b/f1elo/interface.py
@@ -68,11 +68,12 @@ class Interface:
ranks = elo.rank_race(race)
driver_ranks = {}
for entry, rank in ranks.iteritems():
- correction = rank / len(entry.drivers)
- for driver in entry.drivers:
- if driver not in driver_ranks:
- driver_ranks[driver] = 0
- driver_ranks[driver] += correction
+ if entry.result_group:
+ correction = rank / len(entry.drivers)
+ for driver in entry.drivers:
+ if driver not in driver_ranks:
+ driver_ranks[driver] = 0
+ driver_ranks[driver] += correction
for driver, rank in driver_ranks.iteritems():
ranking = Ranking()
ranking.rank_date = race.date