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: