add club auto broadcast

tz
Raz 1 year ago
parent 688db607a0
commit 14e53396d3
  1. 14
      tournaments/views.py

@ -332,14 +332,14 @@ def club_broadcast_auto(request, broadcast_code):
tournaments = Tournament.objects.filter( tournaments = Tournament.objects.filter(
q_not_deleted, 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(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(is_private=False) # Exclude private tournaments ) |
).filter( (Q(end_date__isnull=False) & Q(end_date__gte=recent_time_window)) # Include tournaments finished within the last 4 hours
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
) )
tournament_ids = [str(tournament.id) for tournament in tournaments] tournament_ids = [str(tournament.id) for tournament in tournaments]

Loading…
Cancel
Save