improve club list page

apikeys
Laurent 3 months ago
parent 66d935e83e
commit 3c41da77bc
  1. 12
      tournaments/views.py

@ -348,11 +348,13 @@ def handle_year_month_filtering(year_param, club_id, filter_type, is_future=True
return available_years, selected_year
def clubs(request):
all_clubs = Club.objects.all().order_by('name')
clubs = []
for club in all_clubs:
if club.events_count() > 0:
clubs.append(club)
# all_clubs = Club.objects.all().order_by('name')
# clubs = []
# for club in all_clubs:
# if club.events_count() > 0:
# clubs.append(club)
clubs = Club.objects.filter(events__tournaments__end_date__isnull=False).distinct()
return render(request, 'tournaments/clubs.html', {
'clubs': clubs,

Loading…
Cancel
Save