1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-02-23 13:01:18 +00:00

Compare commits

..

3 Commits

Author SHA1 Message Date
7984ce8e1d
object -> get_object() 2021-03-14 18:57:51 +01:00
3f46e23588
Email address is no more required 2021-03-11 16:57:23 +01:00
a7665d41b7
Organizers can add other organizers 2021-02-16 10:58:14 +01:00
3 changed files with 5 additions and 4 deletions

View File

@ -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.
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 \
(team.participation.tournament.remote
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 \
user.registration.team and user.registration.team.pk == kwargs["pk"] \
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)
raise PermissionDenied

View File

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

View File

@ -97,7 +97,7 @@ class AddOrganizerView(VolunteerMixin, CreateView):
del context["admin_registration_form"].fields["email_confirmed"]
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"]
return context