1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-25 16:22:22 +00:00

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

View File

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