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

Compare commits

..

No commits in common. "7984ce8e1da42e2a8348c4f23a0202d6fa5a26c0" and "6c064d6570d7203f1d4a9cb91d820b3b8667814c" have entirely different histories.

3 changed files with 4 additions and 5 deletions

View File

@ -179,6 +179,7 @@ class TeamDetailView(LoginRequiredMixin, FormMixin, ProcessFormView, DetailView)
# their health sheet, they confirmed their email address and under-18 people sent their parental 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.coaches.exists() and \ context["can_validate"] = team.students.count() >= 4 and team.coaches.exists() and \
team.participation.tournament 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.photo_authorization for r in team.participants.all()) and \
(team.participation.tournament.remote (team.participation.tournament.remote
or all(r.health_sheet for r in team.students.all() if r.under_18)) and \ or all(r.health_sheet for r in team.students.all() if r.under_18)) and \
@ -292,7 +293,7 @@ class TeamUpdateView(LoginRequiredMixin, UpdateView):
if user.registration.is_admin or user.registration.participates and \ if user.registration.is_admin or user.registration.participates and \
user.registration.team and user.registration.team.pk == kwargs["pk"] \ user.registration.team and user.registration.team.pk == kwargs["pk"] \
or user.registration.is_volunteer \ or user.registration.is_volunteer \
and self.get_object().participation.tournament in user.registration.interesting_tournaments: and self.object.participation.tournament in user.registration.interesting_tournaments:
return super().dispatch(request, *args, **kwargs) return super().dispatch(request, *args, **kwargs)
raise PermissionDenied raise PermissionDenied

View File

@ -14,9 +14,7 @@
<form method="post"> <form method="post">
{% csrf_token %} {% csrf_token %}
{{ form|crispy }} {{ form|crispy }}
<div id="registration_form"> <div id="registration_form"></div>
{{ volunteer_registration_form|crispy }}
</div>
<button class="btn btn-success" type="submit"> <button class="btn btn-success" type="submit">
{% trans "Add organizer" %} {% trans "Add organizer" %}
</button> </button>

View File

@ -97,7 +97,7 @@ class AddOrganizerView(VolunteerMixin, CreateView):
del context["admin_registration_form"].fields["email_confirmed"] del context["admin_registration_form"].fields["email_confirmed"]
if not self.request.user.registration.is_admin: if not self.request.user.registration.is_admin:
context["form"].fields["type"].widget.attrs['readonly'] = True del context["form"].fields["type"]
del context["admin_registration_form"] del context["admin_registration_form"]
return context return context