From f41b2e16ab4c5e98bf2f8d335b2c5e6d6ade7a94 Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Wed, 5 Apr 2023 19:40:47 +0200 Subject: [PATCH] Cancel choose problem Signed-off-by: Emmy D'Anello --- draw/consumers.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/draw/consumers.py b/draw/consumers.py index 6e8adb7..a67f98d 100644 --- a/draw/consumers.py +++ b/draw/consumers.py @@ -962,8 +962,19 @@ class DrawConsumer(AsyncJsonWebsocketConsumer): 'round': r.number, 'team': td.participation.team.trigram, 'problem': td.accepted}) - elif state == 'WAITING_DRAW_PROBLEM': - pass + elif state == 'WAITING_CHOOSE_PROBLEM': + td = self.tournament.draw.current_round.current_pool.current_team + td.purposed = None + await td.asave() + + await self.channel_layer.group_send(f"team-{td.participation.team.trigram}", + {'type': 'draw.buttons_visibility', 'visible': False}) + await self.channel_layer.group_send(f"volunteer-{self.tournament.id}", + {'type': 'draw.buttons_visibility', 'visible': False}) + await self.channel_layer.group_send(f"team-{td.participation.team.trigram}", + {'type': 'draw.box_visibility', 'visible': True}) + await self.channel_layer.group_send(f"volunteer-{self.tournament.id}", + {'type': 'draw.box_visibility', 'visible': True}) await self.channel_layer.group_send(f"tournament-{self.tournament.id}", {'type': 'draw.set_info', 'draw': self.tournament.draw})