object -> get_object()

This commit is contained in:
Yohann D'ANELLO 2021-03-14 18:57:51 +01:00
parent 3f46e23588
commit 7984ce8e1d
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 1 additions and 1 deletions

View File

@ -292,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