health_sheet field is now in StudentRegistration

This commit is contained in:
Yohann D'ANELLO 2021-01-21 22:16:01 +01:00
parent b40c06fe9e
commit 1a63c1f399
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 1 additions and 1 deletions

View File

@ -486,7 +486,7 @@ class HealthSheetView(LoginRequiredMixin, View):
path = f"media/authorization/health/{filename}"
if not os.path.exists(path):
raise Http404
student = ParticipantRegistration.objects.get(health_sheet__endswith=filename)
student = StudentRegistration.objects.get(health_sheet__endswith=filename)
user = request.user
if not (student.user == user or user.registration.is_admin or user.registration.is_volunteer and student.team
and student.team.participation.tournament in user.registration.organized_tournaments.all()):