1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-25 18:22:23 +00:00

Fix team validation

This commit is contained in:
ynerant 2021-02-07 17:40:29 +01:00
parent c9067d5202
commit 7a0cb64fb6
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85

View File

@ -234,7 +234,7 @@ class TeamDetailView(LoginRequiredMixin, FormMixin, ProcessFormView, DetailView)
"""
An admin validates the team (or not)
"""
if not self.request.user.user.registration.is_admin and \
if not self.request.user.registration.is_admin and \
(not self.object.participation.tournament
or self.request.user.registration not in self.object.participation.tournament.organizers.all()):
form.add_error(None, _("You are not an organizer of the tournament."))