Corr. fiche indemnité superviseur

This commit is contained in:
Claude Paroz 2023-07-13 09:04:56 +02:00
parent da46061a5a
commit 0135cc43c7

View file

@ -560,8 +560,11 @@ class PrintCompensationForm(PDFBaseView):
self.typ = self.kwargs['typ']
if self.typ in ('mentor', 'supervisor'):
student = self.get_object()
if not student.mentor:
messages.error(request, "Aucun mentor/superviseur nest attribué à cet étudiant")
if self.typ == 'mentor' and not student.mentor:
messages.error(request, "Aucun mentor nest attribué à cet étudiant")
return redirect(reverse("admin:stages_student_change", args=(student.pk,)))
elif self.typ == 'supervisor' and not student.supervisor:
messages.error(request, "Aucun superviseur nest attribué à cet étudiant")
return redirect(reverse("admin:stages_student_change", args=(student.pk,)))
else:
exam = self.get_object()