mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-02-23 17:41:18 +00:00
Compare commits
3 Commits
6c064d6570
...
7984ce8e1d
Author | SHA1 | Date | |
---|---|---|---|
7984ce8e1d | |||
3f46e23588 | |||
a7665d41b7 |
@ -179,7 +179,6 @@ 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 \
|
||||||
@ -293,7 +292,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.object.participation.tournament in user.registration.interesting_tournaments:
|
and self.get_object().participation.tournament in user.registration.interesting_tournaments:
|
||||||
return super().dispatch(request, *args, **kwargs)
|
return super().dispatch(request, *args, **kwargs)
|
||||||
raise PermissionDenied
|
raise PermissionDenied
|
||||||
|
|
||||||
|
@ -14,7 +14,9 @@
|
|||||||
<form method="post">
|
<form method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{{ form|crispy }}
|
{{ form|crispy }}
|
||||||
<div id="registration_form"></div>
|
<div id="registration_form">
|
||||||
|
{{ 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>
|
||||||
|
@ -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:
|
||||||
del context["form"].fields["type"]
|
context["form"].fields["type"].widget.attrs['readonly'] = True
|
||||||
del context["admin_registration_form"]
|
del context["admin_registration_form"]
|
||||||
|
|
||||||
return context
|
return context
|
||||||
|
Loading…
x
Reference in New Issue
Block a user