From 7f7d921c537559b561338f7352730d357e3e4ad4 Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Tue, 28 Mar 2023 21:17:00 +0200 Subject: [PATCH] We want to avoid that a team chooses twice a same problem, not to wait an infinite loop Signed-off-by: Emmy D'Anello --- draw/consumers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/draw/consumers.py b/draw/consumers.py index 85a59b3..0a5b33f 100644 --- a/draw/consumers.py +++ b/draw/consumers.py @@ -371,7 +371,8 @@ class DrawConsumer(AsyncJsonWebsocketConsumer): problem = randint(1, settings.PROBLEM_COUNT) if await TeamDraw.objects.filter(participation_id=td.participation_id, round__draw__tournament=self.tournament, - round__number=1).aexists(): + round__number=1, + purposed=problem).aexists(): continue if await pool.teamdraw_set.filter(accepted=problem).acount() < (2 if pool.size == 5 else 1): break