Exchange first and last teams if there is only one pool (event if there are only 3 or 4 teams)

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello 2024-04-17 00:02:02 +02:00
parent 338a19ec32
commit 21c4d5d7f5
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 4 additions and 4 deletions

View File

@ -456,10 +456,10 @@ class DrawConsumer(AsyncJsonWebsocketConsumer):
td2 = await TeamDraw.objects.filter(participation=td.participation, round=round2).aget()
td2.pool = round2_pools[current_pool_id]
td2.passage_index = current_passage_index
if len(round2_pools) == 1 and len(tds) == 5:
# Exchange teams 1 and 5 if there is only one pool with 5 teams
if i == 0 or i == 4:
td2.passage_index = 4 - i
if len(round2_pools) == 1:
# Exchange first and last team if there is only one pool
if i == 0 or i == len(tds) - 1:
td2.passage_index = len(tds) - 1 - i
current_passage_index += 1
await td2.asave()