From dd45f77a5ed5e0c91be47ccdc80b5b3d661be7dc Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Fri, 7 Jun 2024 23:47:05 +0200 Subject: [PATCH] Fix draw Signed-off-by: Emmy D'Anello --- draw/consumers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/draw/consumers.py b/draw/consumers.py index ec7ba31..9e7a398 100644 --- a/draw/consumers.py +++ b/draw/consumers.py @@ -531,8 +531,8 @@ class DrawConsumer(AsyncJsonWebsocketConsumer): {'tid': self.tournament_id, 'type': 'draw.dice_visibility', 'visible': True}) - # First send the second pool to have the good team order - async for r in self.tournament.draw.round_set.filter(number__gte=2).all(): + # First send the pools of next rounds to have the good team order + async for next_round in self.tournament.draw.round_set.filter(number__gte=2).all(): await self.channel_layer.group_send(f"tournament-{self.tournament.id}", {'tid': self.tournament_id, 'type': 'draw.send_poules', 'round': r.number, @@ -541,7 +541,7 @@ class DrawConsumer(AsyncJsonWebsocketConsumer): 'letter': pool.get_letter_display(), 'teams': await pool.atrigrams(), } - async for pool in r.pool_set.order_by('letter').all() + async for pool in next_round.pool_set.order_by('letter').all() ]}) await self.channel_layer.group_send(f"tournament-{self.tournament.id}", {'tid': self.tournament_id, 'type': 'draw.send_poules',