1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-07-04 01:32:11 +02:00

Don't request too many authorizations for remote tournaments

This commit is contained in:
Yohann D'ANELLO
2021-01-23 19:57:25 +01:00
parent 4dd3c105fe
commit 2bd6988c6a
8 changed files with 223 additions and 182 deletions

View File

@ -177,10 +177,13 @@ class TeamDetailView(LoginRequiredMixin, FormMixin, ProcessFormView, DetailView)
# A team is complete when there are at least 4 members plus a coache that have sent their authorizations,
# their health sheet, they confirmed their email address and under-18 people sent their parental authorization.
context["can_validate"] = team.students.count() >= 4 and team.coaches.exists() and \
team.participation.tournament and \
all(r.email_confirmed for r in team.students.all()) and \
all(r.photo_authorization for r in team.participants.all()) and \
all(r.health_sheet for r in team.students.all() if r.under_18) and \
all(r.parental_authorization for r in team.students.all() if r.under_18) and \
(team.participation.tournament.remote
or all(r.health_sheet for r in team.students.all() if r.under_18)) and \
(team.participation.tournament.remote
or all(r.parental_authorization for r in team.students.all() if r.under_18)) and \
team.motivation_letter
return context