Admins can (in)validate participations

This commit is contained in:
ynerant 2021-02-07 17:31:50 +01:00
parent 2b02c250a2
commit 200848816d
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 3 additions and 2 deletions

View File

@ -234,8 +234,9 @@ class TeamDetailView(LoginRequiredMixin, FormMixin, ProcessFormView, DetailView)
""" """
An admin validates the team (or not) An admin validates the team (or not)
""" """
if not self.object.participation.tournament \ if not self.request.user.user.registration.is_admin and \
or self.request.user.registration not in self.object.participation.tournament.organizers.all(): (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.")) form.add_error(None, _("You are not an organizer of the tournament."))
return self.form_invalid(form) return self.form_invalid(form)
elif self.object.participation.valid is not False: elif self.object.participation.valid is not False: