Assiduites : fix delete justificatif en double

This commit is contained in:
Iziram 2023-11-20 11:01:22 +01:00
parent 988f577f6e
commit 441a893f12

View File

@ -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):