mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-02-24 13:41:19 +00:00
Compare commits
2 Commits
630633bab4
...
bf5c673739
Author | SHA1 | Date | |
---|---|---|---|
|
bf5c673739 | ||
|
a62e906b0e |
@ -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):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user