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

Must be authenticated to upload notes

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello 2023-04-10 10:05:14 +02:00
parent 3d7a39a593
commit 80f0baac1e
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85

View File

@ -797,9 +797,10 @@ class PoolUploadNotesView(VolunteerMixin, FormView, DetailView):
def dispatch(self, request, *args, **kwargs):
self.object = self.get_object()
if request.user.registration.is_admin or request.user.registration.is_volunteer \
and (self.object.tournament in request.user.registration.organized_tournaments.all()
or request.user.registration in self.object.juries.all()):
if request.user.is_authenticated and \
(request.user.registration.is_admin or request.user.registration.is_volunteer
and (self.object.tournament in request.user.registration.organized_tournaments.all()
or request.user.registration in self.object.juries.all())):
return super().dispatch(request, *args, **kwargs)
return self.handle_no_permission()