Minor fixes

clubs
Laurent 1 year ago
parent 6456257ebc
commit 5c3fb40f33
  1. 5
      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:

Loading…
Cancel
Save