Fix script that generates data for second teams when there are 5 teams in the pool

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello 2024-04-19 18:38:19 +02:00
parent 86e978faf2
commit 68da61a33b
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
3 changed files with 9 additions and 11 deletions

View File

@ -7,7 +7,7 @@ from django.utils.translation import activate
import gspread
from gspread.utils import a1_range_to_grid_range, MergeType
from ...models import Tournament
from ...models import Passage, Tournament
class Command(BaseCommand):
@ -50,14 +50,14 @@ class Command(BaseCommand):
team2, score2 = sorted_notes[1]
team3, score3 = sorted_notes[2]
pool1 = tournament.pools.get(round=1, participations=team2)
defender_passage_1 = pool1.passages.get(defender=team2)
opponent_passage_1 = pool1.passages.get(opponent=team2)
reporter_passage_1 = pool1.passages.get(reporter=team2)
pool2 = tournament.pools.get(round=2, participations=team2)
defender_passage_2 = pool2.passages.get(defender=team2)
opponent_passage_2 = pool2.passages.get(opponent=team2)
reporter_passage_2 = pool2.passages.get(reporter=team2)
pool1 = tournament.pools.filter(round=1, participations=team2).first()
defender_passage_1 = Passage.objects.get(pool__tournament=tournament, pool__round=1, defender=team2)
opponent_passage_1 = Passage.objects.get(pool__tournament=tournament, pool__round=1, opponent=team2)
reporter_passage_1 = Passage.objects.get(pool__tournament=tournament, pool__round=1, reporter=team2)
pool2 = tournament.pools.filter(round=2, participations=team2).first()
defender_passage_2 = Passage.objects.get(pool__tournament=tournament, pool__round=2, defender=team2)
opponent_passage_2 = Passage.objects.get(pool__tournament=tournament, pool__round=2, opponent=team2)
reporter_passage_2 = Passage.objects.get(pool__tournament=tournament, pool__round=2, reporter=team2)
line.append(team2.team.trigram)
line.append(str(pool1.jury_president or ""))

View File

@ -866,7 +866,6 @@ class Participation(models.Model):
'content': content,
})
elif timezone.now() <= tournament.syntheses_second_phase_limit + timedelta(hours=2):
pool = self.pools.get(round=2, tournament=tournament)
defender_passage = Passage.objects.get(pool__tournament=self.tournament, pool__round=2, defender=self)
opponent_passage = Passage.objects.get(pool__tournament=self.tournament, pool__round=2, opponent=self)
reporter_passage = Passage.objects.get(pool__tournament=self.tournament, pool__round=2, reporter=self)

View File

@ -1660,7 +1660,6 @@ class PoolNotesTemplateView(VolunteerMixin, DetailView):
table.addElement(TableRow())
if self.object.participations.count() == 5:
# 5-teams pools are separated in two different objects.
# So, displaying the ranking may don't make any sens. We don't display it for this reason.