mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-25 03:40:31 +02:00
Fix the drawing resume for the final
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
@ -988,8 +988,7 @@ class DrawConsumer(AsyncJsonWebsocketConsumer):
|
||||
async for participation in self.tournament.participations.filter(valid=True).prefetch_related('team').all():
|
||||
notes[participation] = sum([await pool.aaverage(participation)
|
||||
async for pool in self.tournament.pools.filter(participations=participation)
|
||||
.prefetch_related('passages').prefetch_related('tweaks')
|
||||
if pool.results_available])
|
||||
.prefetch_related('passages')])
|
||||
# Sort notes in a decreasing order
|
||||
ordered_participations = sorted(notes.keys(), key=lambda x: -notes[x])
|
||||
# Define pools and passage orders from the ranking of the first round
|
||||
@ -1368,7 +1367,7 @@ class DrawConsumer(AsyncJsonWebsocketConsumer):
|
||||
else:
|
||||
# Don't continue the final tournament
|
||||
r1 = await self.tournament.draw.round_set \
|
||||
.prefetch_related('current_pool__current__team__participation__team').aget(number=1)
|
||||
.prefetch_related('current_pool__current_team__participation__team').aget(number=1)
|
||||
self.tournament.draw.current_round = r1
|
||||
await self.tournament.draw.asave()
|
||||
|
||||
@ -1378,6 +1377,19 @@ class DrawConsumer(AsyncJsonWebsocketConsumer):
|
||||
td.choice_dice = None
|
||||
await td.asave()
|
||||
|
||||
await self.channel_layer.group_send(f"tournament-{self.tournament.id}",
|
||||
{
|
||||
'tid': self.tournament_id,
|
||||
'type': 'draw.send_poules',
|
||||
'round': 2, 'poules': [
|
||||
{
|
||||
'letter': pool.get_letter_display(),
|
||||
'teams': [],
|
||||
}
|
||||
async for pool in r.pool_set.order_by('letter').all()
|
||||
]
|
||||
})
|
||||
|
||||
async for td in r1.team_draws.prefetch_related('participation__team').all():
|
||||
await self.channel_layer.group_send(
|
||||
f"tournament-{self.tournament.id}", {'tid': self.tournament_id, 'type': 'draw.dice',
|
||||
|
Reference in New Issue
Block a user