From feee5069b165276e69fddb5b4418c00e9b41070d Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Thu, 11 May 2023 17:15:50 +0200 Subject: [PATCH] Add notification when the draw of the final is resumed Signed-off-by: Emmy D'Anello --- draw/consumers.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/draw/consumers.py b/draw/consumers.py index 31f893f..23384d6 100644 --- a/draw/consumers.py +++ b/draw/consumers.py @@ -969,6 +969,12 @@ class DrawConsumer(AsyncJsonWebsocketConsumer): self.tournament.draw.last_message = msg await self.tournament.draw.asave() + # Send notification to everyone + await self.channel_layer.group_send(f"tournament-{self.tournament.id}", + {'tid': self.tournament_id, 'type': 'draw.notify', + 'title': 'Tirage au sort du TFJM²', + 'body': "Le tirage au sort pour le second tour de la finale a commencé !"}) + # Set the first pool of the second round as the active pool pool = await Pool.objects.filter(round=self.tournament.draw.current_round, letter=1).aget() r2.current_pool = pool