Raz 8 months ago
commit 7eabf9f444
  1. 2
      tournaments/models/group_stage.py
  2. 6
      tournaments/models/team_registration.py
  3. 4
      tournaments/models/tournament.py

@ -4,7 +4,7 @@ from django.db import models
from . import SideStoreModel, Tournament, FederalMatchCategory
import uuid
from ..utils.extensions import format_seconds
# from datetime import datetime, timedelta
from datetime import timedelta
from django.utils import timezone
from django.db.models import Count, Q

@ -177,9 +177,9 @@ class TeamRegistration(SideStoreModel):
def get_matches(self):
matches = Match.objects.filter(team_scores__team_registration=self).distinct()
print(f"All matches for team {self.id}: {matches.count()}")
for match in matches:
print(f"Match {match.id}: start_date={match.start_date}, end_date={match.end_date}")
# print(f"All matches for team {self.id}: {matches.count()}")
# for match in matches:
# print(f"Match {match.id}: start_date={match.start_date}, end_date={match.end_date}")
return matches
def get_upcoming_matches(self):

@ -278,7 +278,7 @@ class Tournament(BaseModel):
def team_summons(self):
summons = []
if self.supposedly_in_progress() and self.end_date is None:
print('>>> team_summons supposedly_in_progress')
# print('>>> team_summons supposedly_in_progress')
for team in self.teams(False):
names = team.names
stage = team.stage
@ -286,7 +286,7 @@ class Tournament(BaseModel):
summon = TeamSummon(team.team_registration.id, names, team.date, weight, stage, "", team.image, self.day_duration)
summons.append(summon)
else:
print('>>> team_summons')
# print('>>> team_summons')
for team_registration in self.team_registrations.all():
if team_registration.is_valid_for_summon():
next_match = team_registration.next_match()

Loading…
Cancel
Save