From 441a893f12609f28f70942f301e07381878ad787 Mon Sep 17 00:00:00 2001 From: Iziram Date: Mon, 20 Nov 2023 11:01:22 +0100 Subject: [PATCH] Assiduites : fix delete justificatif en double --- app/scodoc/sco_archives_justificatifs.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/scodoc/sco_archives_justificatifs.py b/app/scodoc/sco_archives_justificatifs.py index 125569d0..60c3bd8d 100644 --- a/app/scodoc/sco_archives_justificatifs.py +++ b/app/scodoc/sco_archives_justificatifs.py @@ -157,10 +157,15 @@ class JustificatifArchiver(BaseArchiver): Si trace == True : sauvegarde le nom du/des fichier(s) supprimé(s) dans la trace de l'étudiant """ + print("debug : ", archive_name, filename, has_trace) if str(etud.id) not in self.list_oids(etud.dept_id): raise ValueError(f"Aucune archive pour etudid[{etud.id}]") - - archive_id = self.get_id_from_name(etud.id, archive_name, dept_id=etud.dept_id) + try: + archive_id = self.get_id_from_name( + etud.id, archive_name, dept_id=etud.dept_id + ) + except ScoValueError: + raise ValueError(f"Archive Inconnue [{archive_name}]") if filename is not None: if filename not in self.list_archive(archive_id, dept_id=etud.dept_id):