diff --git a/app/scodoc/sco_archives.py b/app/scodoc/sco_archives.py index 839780fe3..55d7b0685 100644 --- a/app/scodoc/sco_archives.py +++ b/app/scodoc/sco_archives.py @@ -220,15 +220,18 @@ class BaseArchiver(object): def create_obj_archive(self, oid: int, description: str): """Creates a new archive for this object and returns its id.""" + # id suffixé par YYYY-MM-DD-hh-mm-ss archive_id = ( self.get_obj_dir(oid) + os.path.sep - + "-".join(["%02d" % x for x in time.localtime()[:6]]) + + "-".join(["{x:02d}" for x in time.localtime()[:6]]) ) log(f"creating archive: {archive_id}") try: scu.GSL.acquire() - os.mkdir(archive_id) # if exists, raises FileExistsError + os.mkdir(archive_id) + except FileExistsError: # directory already exists ! + pass finally: scu.GSL.release() self.store(archive_id, "_description.txt", description) diff --git a/app/scodoc/sco_pv_forms.py b/app/scodoc/sco_pv_forms.py index af6cb65ba..a60a88ca3 100644 --- a/app/scodoc/sco_pv_forms.py +++ b/app/scodoc/sco_pv_forms.py @@ -333,7 +333,7 @@ def formsemestre_pvjury_pdf(formsemestre_id, group_ids: list[int] = None, etudid # PV pour ce seul étudiant: etud = Identite.query.get_or_404(etudid) etuddescr = f"""{etud.nomprenom}""" etudids = [etudid] else: