bracket-feature
laurent 1 year ago
commit 2f3fb96a7f
  1. 14
      tournaments/views.py

@ -332,14 +332,14 @@ def club_broadcast_auto(request, broadcast_code):
tournaments = Tournament.objects.filter(
q_not_deleted,
Q(is_private=False), # Exclude private tournaments
(
Q(end_date__isnull=True) | # Include ongoing tournaments
Q(start_date__lt=now + timedelta(days=3)) # Include tournaments starting in the next 3 days
),
Q(is_private=False) # Exclude private tournaments
).filter(
Q(end_date__gte=recent_time_window) | # Include tournaments that just finished in the last 4 hours
Q(end_date__isnull=True) # Ensure ongoing tournaments are included
(
Q(end_date__isnull=True) & # Include ongoing tournaments
(Q(start_date__gte=now - timedelta(days=3)) & Q(start_date__lt=now + timedelta(days=3))) # Include tournaments that are ongoing and start within 3 days
) |
(Q(end_date__isnull=False) & Q(end_date__gte=recent_time_window)) # Include tournaments finished within the last 4 hours
)
)
tournament_ids = [str(tournament.id) for tournament in tournaments]

Loading…
Cancel
Save