From 5c3fb40f33055e47fe4b35ee359403386210c325 Mon Sep 17 00:00:00 2001 From: Laurent Date: Wed, 12 Jun 2024 09:59:39 +0200 Subject: [PATCH] Minor fixes --- tournaments/models/tournament.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index 132dd64..437bc4d 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -130,7 +130,7 @@ class Tournament(models.Model): teams = self.teams() if self.supposedly_in_progress() or self.end_date is not None: - teams = [t for t in teams if t.stage is not "Attente"] + teams = [t for t in teams if t.stage != "Attente"] if teams is not None and len(teams) > 0: word = "équipe" if len(teams) > 1: @@ -458,6 +458,7 @@ class Tournament(models.Model): for group_stage in self.groupstage_set.all(): matches.extend(group_stage.match_set.all()) matches = [m for m in matches if m.should_appear()] + # matches = [m for m in matches if m.start_date] matches.sort(key=lambda m: m.start_date, reverse=True) return matches @@ -564,7 +565,7 @@ class Tournament(models.Model): return date.replace(hour=8, minute=0, second=0, microsecond=0) def supposedly_in_progress(self): - end = self.start_date + timedelta(days=self.day_duration) + end = self.start_date + timedelta(days=self.day_duration + 2) return self.start_date.replace(hour=0, minute=0) <= timezone.now() <= end class MatchGroup: