1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-21 12:38:26 +02:00

Address, responsible and phone number were missing. Use Google Maps API to query the address, to ensure to have valid addresses

This commit is contained in:
Yohann D'ANELLO
2020-12-28 23:59:21 +01:00
parent 95fec7c0da
commit 72753edf64
10 changed files with 118 additions and 11 deletions

View File

@ -4,7 +4,6 @@
{% load crispy_forms_filters %}
{% block content %}
<div class="card bg-light shadow">
<div class="card-header text-center">
<h4>{{ team.name }}</h4>
@ -77,7 +76,7 @@
{% if user.registration.participates %}
{% if can_validate %}
<div class="alert alert-info">
{% trans "Your team has at least 3 members and all photo authorizations were given: the team can be validated." %}
{% trans "Your team has at least 4 members and a coach and all photo authorizations were given: the team can be validated." %}
<div class="text-center">
<form method="post">
{% csrf_token %}
@ -88,7 +87,7 @@
</div>
{% else %}
<div class="alert alert-warning">
{% trans "Your team must be composed of 3 members and each member must upload its photo authorization and confirm its email address." %}
{% trans "Your team must be composed of 4 members and a coach and each member must upload its photo authorization and confirm its email address." %}
</div>
{% endif %}
{% else %}

View File

@ -171,11 +171,13 @@ class TeamDetailView(LoginRequiredMixin, FormMixin, ProcessFormView, DetailView)
context["title"] = _("Detail of team {trigram}").format(trigram=self.object.trigram)
context["request_validation_form"] = RequestValidationForm(self.request.POST or None)
context["validation_form"] = ValidateParticipationForm(self.request.POST or None)
# A team is complete when there are at least 3 members that have sent their photo authorization
# and confirmed their email address
context["can_validate"] = team.students.count() >= 3 and \
# A team is complete when there are at least 4 members plus a coache that have sent their photo authorization,
# 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.coachs.exists() and \
all(r.email_confirmed for r in team.students.all()) and \
all(r.photo_authorization for r in team.students.all())
all(r.photo_authorization for r in team.participants.all()) and \
all(r.health_sheet for r in team.participants.all()) and \
all(r.parental_authorization for r in team.students.all() if r.under_18)
return context