From a0427b81c2de61c7ed40ca482294f19d3f565f8b Mon Sep 17 00:00:00 2001 From: Laurent Date: Wed, 9 Apr 2025 15:48:37 +0200 Subject: [PATCH] fix issue where matches were displayed for the teams when no match should be shown --- tournaments/models/team_registration.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tournaments/models/team_registration.py b/tournaments/models/team_registration.py index d2360fe..f39453e 100644 --- a/tournaments/models/team_registration.py +++ b/tournaments/models/team_registration.py @@ -181,6 +181,9 @@ class TeamRegistration(SideStoreModel): return matches def get_upcoming_matches(self): + if self.tournament and self.tournament.display_matches() is False: + return [] + matches = self.get_matches() upcoming = matches.filter(end_date__isnull=True).order_by('start_date') print(f"Upcoming matches count: {upcoming.count()}")