From 6be8dc3667acc20997f2af2f557a2d29eb4950a3 Mon Sep 17 00:00:00 2001 From: Laurent Date: Wed, 25 Sep 2024 10:07:54 +0200 Subject: [PATCH] Fix crash --- tournaments/models/tournament.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()