We want to avoid that a team chooses twice a same problem, not to wait an infinite loop
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
parent
8668430760
commit
7f7d921c53
|
@ -371,7 +371,8 @@ class DrawConsumer(AsyncJsonWebsocketConsumer):
|
||||||
problem = randint(1, settings.PROBLEM_COUNT)
|
problem = randint(1, settings.PROBLEM_COUNT)
|
||||||
if await TeamDraw.objects.filter(participation_id=td.participation_id,
|
if await TeamDraw.objects.filter(participation_id=td.participation_id,
|
||||||
round__draw__tournament=self.tournament,
|
round__draw__tournament=self.tournament,
|
||||||
round__number=1).aexists():
|
round__number=1,
|
||||||
|
purposed=problem).aexists():
|
||||||
continue
|
continue
|
||||||
if await pool.teamdraw_set.filter(accepted=problem).acount() < (2 if pool.size == 5 else 1):
|
if await pool.teamdraw_set.filter(accepted=problem).acount() < (2 if pool.size == 5 else 1):
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue