From a97d7d621b100bdb1f71f5782e49bd8b2ea88bd0 Mon Sep 17 00:00:00 2001 From: Raz Date: Sun, 23 Mar 2025 18:34:06 +0100 Subject: [PATCH] fix issue with page club --- tournaments/views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tournaments/views.py b/tournaments/views.py index 081fa02..4ef59f1 100644 --- a/tournaments/views.py +++ b/tournaments/views.py @@ -111,7 +111,11 @@ def index(request): thirty_days_future = now + timedelta(days=30) club_id = request.GET.get('club') - tournaments = tournaments_query(Q(end_date__isnull=True, start_date__gte=thirty_days_ago, start_date__lte=thirty_days_future), club_id, True, 50) + if club_id: + tournaments = tournaments_query(Q(end_date__isnull=True), club_id, True, 50) + else: + tournaments = tournaments_query(Q(end_date__isnull=True, start_date__gte=thirty_days_ago, start_date__lte=thirty_days_future), club_id, True, 50) + display_tournament = [t for t in tournaments if t.display_tournament()] live = [] future = []