diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index e11eea1..df11972 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -549,7 +549,7 @@ class Tournament(models.Model): def last_started_match(self): matches = [m for m in self.all_matches(False) if m.start_date] matches.sort(key=lambda m: m.start_date, reverse=True) - return matches[0] + return matches.get(0) # get returns None if not present def round_for_index(self, index): return self.round_set.filter(index=index, parent=None).first()