|
|
|
@ -130,7 +130,7 @@ class Tournament(models.Model): |
|
|
|
|
|
|
|
|
|
|
|
teams = self.teams() |
|
|
|
teams = self.teams() |
|
|
|
if self.supposedly_in_progress() or self.end_date is not None: |
|
|
|
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: |
|
|
|
if teams is not None and len(teams) > 0: |
|
|
|
word = "équipe" |
|
|
|
word = "équipe" |
|
|
|
if len(teams) > 1: |
|
|
|
if len(teams) > 1: |
|
|
|
@ -458,6 +458,7 @@ class Tournament(models.Model): |
|
|
|
for group_stage in self.groupstage_set.all(): |
|
|
|
for group_stage in self.groupstage_set.all(): |
|
|
|
matches.extend(group_stage.match_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.should_appear()] |
|
|
|
|
|
|
|
# matches = [m for m in matches if m.start_date] |
|
|
|
matches.sort(key=lambda m: m.start_date, reverse=True) |
|
|
|
matches.sort(key=lambda m: m.start_date, reverse=True) |
|
|
|
return matches |
|
|
|
return matches |
|
|
|
|
|
|
|
|
|
|
|
@ -564,7 +565,7 @@ class Tournament(models.Model): |
|
|
|
return date.replace(hour=8, minute=0, second=0, microsecond=0) |
|
|
|
return date.replace(hour=8, minute=0, second=0, microsecond=0) |
|
|
|
|
|
|
|
|
|
|
|
def supposedly_in_progress(self): |
|
|
|
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 |
|
|
|
return self.start_date.replace(hour=0, minute=0) <= timezone.now() <= end |
|
|
|
|
|
|
|
|
|
|
|
class MatchGroup: |
|
|
|
class MatchGroup: |
|
|
|
|