mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-25 19:37:26 +02:00
Add continue button for the final tournament
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
@ -42,7 +42,10 @@ class Draw(models.Model):
|
||||
elif self.current_round.current_pool.current_team is None:
|
||||
return 'DICE_ORDER_POULE'
|
||||
elif self.current_round.current_pool.current_team.accepted is not None:
|
||||
return 'DRAW_ENDED'
|
||||
if self.current_round.number == 1:
|
||||
return 'WAITING_FINAL'
|
||||
else:
|
||||
return 'DRAW_ENDED'
|
||||
elif self.current_round.current_pool.current_team.purposed is None:
|
||||
return 'WAITING_DRAW_PROBLEM'
|
||||
else:
|
||||
@ -93,6 +96,8 @@ class Draw(models.Model):
|
||||
s += "Refuser ce problème ajoutera une nouvelle pénalité de 0.5 sur le coefficient de l'oral de læ défenseur⋅se."
|
||||
else:
|
||||
s += f"Il reste {settings.PROBLEM_COUNT - 5 - len(td.rejected)} refus sans pénalité."
|
||||
case 'WAITING_FINAL':
|
||||
s += "Le tirage au sort pour le tour 2 aura lieu à la fin du premier tour. Bon courage !"
|
||||
case 'DRAW_ENDED':
|
||||
s += "Le tirage au sort est terminé. Les solutions des autres équipes peuvent être trouvées dans l'onglet « Ma participation »."
|
||||
|
||||
@ -210,7 +215,8 @@ class Pool(models.Model):
|
||||
|
||||
@property
|
||||
def exportable(self):
|
||||
return self.associated_pool is None and all(td.accepted is not None for td in self.teamdraw_set.all())
|
||||
return self.associated_pool is None and self.teamdraw_set.exists() \
|
||||
and all(td.accepted is not None for td in self.teamdraw_set.all())
|
||||
|
||||
def export(self):
|
||||
from django.db import transaction
|
||||
@ -222,6 +228,7 @@ class Pool(models.Model):
|
||||
self.associated_pool.juries.set(self.round.draw.tournament.organizers.all())
|
||||
tds = list(self.team_draws)
|
||||
self.associated_pool.participations.set([td.participation for td in tds])
|
||||
self.save()
|
||||
|
||||
if len(tds) == 3:
|
||||
table = [
|
||||
|
Reference in New Issue
Block a user