From 9be436fccfdff7cef9658dcf203c30453740dc72 Mon Sep 17 00:00:00 2001 From: Laurent Date: Thu, 8 May 2025 16:45:37 +0200 Subject: [PATCH] attempt to fix broadcast display --- tournaments/models/tournament.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index 6ddcafa..c387860 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -838,6 +838,7 @@ class Tournament(BaseModel): matches = [m for m in matches if m.should_appear() and (m.start_date is None or m.start_date <= future_threshold) and # Not starting in more than 1h (m.end_date is None or m.end_date >= past_threshold)] # Not finished for more than 1h + matches.sort(key=lambda m: (m.start_date is not None)) # display started matches matches = matches[:16] matches.sort(key=lambda m: (m.start_date is None, m.end_date is not None, m.start_date, m.index))