hide clubs without event

tz
Laurent 1 year ago
parent f733f8d6e3
commit 3662b4f5ee
  1. 7
      tournaments/views.py

@ -111,7 +111,12 @@ def tournaments(request):
)
def clubs(request):
clubs = Club.objects.all().order_by('name')
all_clubs = Club.objects.all().order_by('name')
clubs = []
for club in all_clubs:
if club.events_count() > 0:
clubs.append(club)
return render(request, 'tournaments/clubs.html', {
'clubs': clubs,
})

Loading…
Cancel
Save