Add EDE mentor compensation form
This commit is contained in:
parent
d3d8d1dfc5
commit
883538af34
5 changed files with 164 additions and 90 deletions
|
|
@ -34,7 +34,7 @@ from .models import (
|
|||
Klass, Section, Option, Student, Teacher, Corporation, CorpContact, Course, Period,
|
||||
Training, Availability,
|
||||
)
|
||||
from .pdf import ExaminationCompensationPdfForm, ExpertEDEPDF, UpdateDataFormPDF
|
||||
from .pdf import ExpertCompensationPdfForm, ExpertEDEPDF, UpdateDataFormPDF, MentorCompensationPdfForm
|
||||
from .utils import is_int
|
||||
|
||||
|
||||
|
|
@ -930,7 +930,7 @@ def print_pdf_to_expert_ede(request, pk):
|
|||
return response
|
||||
|
||||
|
||||
def print_examination_compensation_form(request, pk):
|
||||
def print_expert_ede_compensation_form(request, pk):
|
||||
"""
|
||||
Imprime le PDF à envoyer à l'expert EDE en accompagnement du
|
||||
travail de diplôme
|
||||
|
|
@ -939,7 +939,24 @@ def print_examination_compensation_form(request, pk):
|
|||
if not student.is_examination_valid:
|
||||
messages.error(request, "Toutes les informations ne sont pas disponibles pour la lettre à l’expert!")
|
||||
return redirect(reverse("admin:stages_student_change", args=(student.pk,)))
|
||||
pdf = ExaminationCompensationPdfForm(student)
|
||||
pdf = ExpertCompensationPdfForm(student)
|
||||
pdf.produce()
|
||||
|
||||
with open(pdf.filename, mode='rb') as fh:
|
||||
response = HttpResponse(fh.read(), content_type='application/pdf')
|
||||
response['Content-Disposition'] = 'attachment; filename="{0}"'.format(os.path.basename(pdf.filename))
|
||||
return response
|
||||
|
||||
|
||||
def print_mentor_ede_compensation_form(request, pk):
|
||||
"""
|
||||
Imprime le PDF à envoyer au mentor EDE pour le mentoring
|
||||
"""
|
||||
student = Student.objects.get(pk=pk)
|
||||
if not student.mentor:
|
||||
messages.error(request, "Aucun mentor n'est attribué à cet étudiant")
|
||||
return redirect(reverse("admin:stages_student_change", args=(student.pk,)))
|
||||
pdf = MentorCompensationPdfForm(student)
|
||||
pdf.produce()
|
||||
|
||||
with open(pdf.filename, mode='rb') as fh:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue