attempt to fix broadcast display

sync_v2
Laurent 6 months ago
parent d474de1edf
commit 9be436fccf
  1. 1
      tournaments/models/tournament.py

@ -838,6 +838,7 @@ class Tournament(BaseModel):
matches = [m for m in matches if m.should_appear() and 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.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 (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 = matches[:16]
matches.sort(key=lambda m: (m.start_date is None, m.end_date is not None, m.start_date, m.index)) matches.sort(key=lambda m: (m.start_date is None, m.end_date is not None, m.start_date, m.index))

Loading…
Cancel
Save