diff --git a/stages/admin.py b/stages/admin.py index 35658c0..e7b6ebb 100644 --- a/stages/admin.py +++ b/stages/admin.py @@ -110,7 +110,7 @@ class StudentAdmin(admin.ModelAdmin): autocomplete_fields = ('corporation', 'instructor', 'supervisor', 'mentor', 'expert', 'expert_ep') readonly_fields = ( 'report_sem1_sent', 'report_sem2_sent', - 'examination_ede_actions', 'examination_eds_actions', + 'examination_actions', 'date_soutenance_mailed', 'date_soutenance_ep_mailed' ) fieldsets = [ @@ -134,8 +134,7 @@ class StudentAdmin(admin.ModelAdmin): ('training_referent', 'referent', 'mentor'), ('internal_expert', 'expert'), ('date_soutenance_mailed', 'date_confirm_received'), - ('examination_ede_actions',), - ('examination_eds_actions',), + ('examination_actions',), ('mark', 'mark_acq'), ) }), @@ -180,7 +179,7 @@ class StudentAdmin(admin.ModelAdmin): student.save() archive.short_description = "Marquer les étudiants sélectionnés comme archivés" - def examination_ede_actions(self, obj): + def examination_actions(self, obj): if self.is_ede_3(obj): if obj.missing_examination_data(): return mark_safe( @@ -196,12 +195,7 @@ class StudentAdmin(admin.ModelAdmin): reverse('student-ede-convocation', args=[obj.pk]), reverse('print-mentor-compens-ede', args=[obj.pk]), ) - else: - return '' - examination_ede_actions.short_description = 'Actions pour les examens EDE' - - def examination_eds_actions(self, obj): - if self.is_eds_3(obj): + elif self.is_eds_3(obj): if obj.missing_examination_data(): return mark_safe( '
Veuillez compléter les informations ' @@ -218,7 +212,7 @@ class StudentAdmin(admin.ModelAdmin): ) else: return '' - examination_eds_actions.short_description = 'Actions pour les examens EDS' + examination_actions.short_description = 'Actions pour les examens' class CorpContactAdmin(admin.ModelAdmin): diff --git a/stages/pdf.py b/stages/pdf.py index 624a658..2295c8f 100644 --- a/stages/pdf.py +++ b/stages/pdf.py @@ -534,14 +534,6 @@ class ExpertEdsLetterPdf(ExpertEdeLetterPdf): La soutenance de ce travail de diplôme se déroulera le:

""" - def exam_data(self): - return { - 'expert': self.student.expert_ep, - 'internal_expert': self.student.internal_expert_ep, - 'date_exam': self.student.date_exam_ep, - 'room': self.student.room_ep, - } - class MentorCompensationPdfForm(CompensationForm, EpcBaseDocTemplate): def __init__(self, out, student): diff --git a/stages/tests.py b/stages/tests.py index f876ee1..3a3fa81 100644 --- a/stages/tests.py +++ b/stages/tests.py @@ -281,15 +281,15 @@ tél. 032 886 33 00 "L’expert interne n’est pas défini"): self.assertContains(response, err) st.email = 'hots@example.org' - st.date_exam_ep = datetime(2018, 6, 28, 12, 00) - st.room_ep = "B123" - st.expert_ep = CorpContact.objects.get(last_name="Horner") - st.internal_expert_ep = Teacher.objects.get(last_name="Caux") + st.date_exam = datetime(2018, 6, 28, 12, 00) + st.room = "B123" + st.expert = CorpContact.objects.get(last_name="Horner") + st.internal_expert = Teacher.objects.get(last_name="Caux") st.save() response = self.client.get(url, follow=True) self.assertContains(response, "L’expert externe n’a pas de courriel valide !") - st.expert_ep.email = "horner@example.org" - st.expert_ep.save() + st.expert.email = "horner@example.org" + st.expert.save() response = self.client.get(url) expected_message = """ Laurent Hots, Madame Julie Caux, @@ -324,7 +324,7 @@ tél. 032 886 33 00 }) self.assertEqual(len(mail.outbox), 1) st.refresh_from_db() - self.assertIsNotNone(st.date_soutenance_ep_mailed) + self.assertIsNotNone(st.date_soutenance_mailed) def test_print_ede_compensation_forms(self): st = Student.objects.get(first_name="Albin") @@ -376,10 +376,10 @@ tél. 032 886 33 00 response = self.client.get(url, follow=True) self.assertContains(response, "Toutes les informations ne sont pas disponibles") - st.expert_ep = CorpContact.objects.get(last_name="Horner") - st.internal_expert_ep = Teacher.objects.get(last_name="Caux") - st.date_exam_ep = datetime(2018, 6, 28, 12, 00) - st.room_ep = "B123" + st.expert = CorpContact.objects.get(last_name="Horner") + st.internal_expert = Teacher.objects.get(last_name="Caux") + st.date_exam = datetime(2018, 6, 28, 12, 00) + st.room = "B123" st.save() response = self.client.get(url, follow=True) @@ -390,7 +390,7 @@ tél. 032 886 33 00 self.assertEqual(response['Content-Type'], 'application/pdf') self.assertGreater(int(response['Content-Length']), 1000) # Expert without corporation - st.expert_ep = CorpContact.objects.create(first_name='James', last_name='Bond') + st.expert = CorpContact.objects.create(first_name='James', last_name='Bond') st.save() response = self.client.get(url, follow=True) self.assertEqual(response.status_code, 200) diff --git a/stages/views/__init__.py b/stages/views/__init__.py index b199fb5..5a7fd1e 100644 --- a/stages/views/__init__.py +++ b/stages/views/__init__.py @@ -492,33 +492,6 @@ class StudentConvocationEDSView(StudentConvocationExaminationView): title = "Convocation à la soutenance du travail final" email_template = 'email/student_convocation_EDS.txt' - @property - def expert(self): - return self.student.expert_ep - - @property - def internal_expert(self): - return self.student.internal_expert_ep - - @property - def date_soutenance_mailed(self): - return self.student.date_soutenance_ep_mailed - - def missing_examination_data(self): - return self.student.missing_examination_ep_data() - - def msg_context(self): - context = super().msg_context() - context.update({ - 'date_examen': django_format(self.student.date_exam_ep, 'l j F Y à H\hi'), - 'salle': self.student.room_ep, - }) - return context - - def on_success(self, student): - self.student.date_soutenance_ep_mailed = timezone.now() - self.student.save() - class PrintUpdateForm(ZippedFilesBaseView): """ @@ -603,7 +576,7 @@ class PrintExpertEDSCompensationForm(PrintExpertEDECompensationForm): pdf_class = ExpertEdsLetterPdf def check_object(self, student): - missing = student.missing_examination_ep_data() + missing = student.missing_examination_data() if missing: messages.error(self.request, "\n".join( ["Toutes les informations ne sont pas disponibles pour la lettre à l’expert!"] diff --git a/templates/email/student_convocation_EDS.txt b/templates/email/student_convocation_EDS.txt index 0a540be..7a573e1 100644 --- a/templates/email/student_convocation_EDS.txt +++ b/templates/email/student_convocation_EDS.txt @@ -8,7 +8,7 @@ Nous vous informons que la soutenance du travail final de {{ student.civility_fu - {{ date_examen }} en salle {{ salle }} -Nous informons également {{ student.expert_ep.civility }} {{ student.expert_ep.last_name }} que le mémoire lui est adressé ce jour par courrier postal. +Nous informons également {{ student.expert.civility }} {{ student.expert.last_name }} que le mémoire lui est adressé ce jour par courrier postal. Nous vous remercions de nous confirmer par retour de courriel que vous avez bien reçu ce message et dans l’attente du plaisir de vous rencontrer prochainement, nous vous prions d’agréer, {{ global_civilities }}, nos salutations les meilleures.