1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-02-24 14:21:19 +00:00

Compare commits

..

2 Commits

Author SHA1 Message Date
Emmy D'Anello
bf5c673739
Update the final ranking page after the draw export
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2024-03-31 13:48:01 +02:00
Emmy D'Anello
a62e906b0e
Hide draw export button sooner to avoid that double exports
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2024-03-31 13:45:32 +02:00

View File

@ -5,6 +5,7 @@ from collections import OrderedDict
import json import json
from random import randint, shuffle from random import randint, shuffle
from asgiref.sync import sync_to_async
from channels.generic.websocket import AsyncJsonWebsocketConsumer from channels.generic.websocket import AsyncJsonWebsocketConsumer
from django.conf import settings from django.conf import settings
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
@ -979,15 +980,17 @@ class DrawConsumer(AsyncJsonWebsocketConsumer):
if not await Draw.objects.filter(tournament=self.tournament).aexists(): if not await Draw.objects.filter(tournament=self.tournament).aexists():
return await self.alert(_("The draw has not started yet."), 'danger') return await self.alert(_("The draw has not started yet."), 'danger')
await self.channel_layer.group_send(f"volunteer-{self.tournament.id}",
{'tid': self.tournament_id, 'type': 'draw.export_visibility',
'visible': False})
# Export each exportable pool # Export each exportable pool
async for r in self.tournament.draw.round_set.all(): async for r in self.tournament.draw.round_set.all():
async for pool in r.pool_set.all(): async for pool in r.pool_set.all():
if await pool.is_exportable(): if await pool.is_exportable():
await pool.export() await pool.export()
await self.channel_layer.group_send(f"volunteer-{self.tournament.id}", await sync_to_async(self.tournament.update_ranking_spreadsheet)()
{'tid': self.tournament_id, 'type': 'draw.export_visibility',
'visible': False})
@ensure_orga @ensure_orga
async def continue_final(self, **kwargs): async def continue_final(self, **kwargs):