|
|
|
|
@ -43,6 +43,13 @@ class GroupStage(models.Model): |
|
|
|
|
team_scores = match.team_scores.all() |
|
|
|
|
if len(team_scores) == 2: |
|
|
|
|
|
|
|
|
|
ts1 = team_scores[0] |
|
|
|
|
ts2 = team_scores[1] |
|
|
|
|
scores1 = ts1.scores() |
|
|
|
|
scores2 = ts2.scores() |
|
|
|
|
|
|
|
|
|
if len(scores1) == len(scores2) and len(scores1) > 0: |
|
|
|
|
|
|
|
|
|
for team_score in match.team_scores.all(): |
|
|
|
|
team_registration = team_score.team_registration |
|
|
|
|
if team_registration in gs_teams: |
|
|
|
|
@ -52,10 +59,6 @@ class GroupStage(models.Model): |
|
|
|
|
else: |
|
|
|
|
team.losses += 1 |
|
|
|
|
|
|
|
|
|
ts1 = team_scores[0] |
|
|
|
|
ts2 = team_scores[1] |
|
|
|
|
scores1 = ts1.scores() |
|
|
|
|
scores2 = ts2.scores() |
|
|
|
|
total1 = 0 |
|
|
|
|
total2 = 0 |
|
|
|
|
|
|
|
|
|
@ -76,7 +79,11 @@ class GroupStage(models.Model): |
|
|
|
|
team1.diff = total1 - total2 |
|
|
|
|
team2.diff = total2 - total1 |
|
|
|
|
|
|
|
|
|
teams = sorted(gs_teams.values(), key=lambda t: t.position) |
|
|
|
|
if len(self.match_set.all()) == 0: |
|
|
|
|
teams = sorted(gs_teams.values(), key=lambda team: team.position) |
|
|
|
|
else: |
|
|
|
|
teams = sorted(gs_teams.values(), key=lambda team: -team.wins) |
|
|
|
|
|
|
|
|
|
for team in teams: |
|
|
|
|
lgs.add_team(team) |
|
|
|
|
return lgs |
|
|
|
|
|