From ea1e5cfb898901885fdd5e459d0893d6028adcd2 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Wed, 12 Jul 2023 14:06:34 +0200 Subject: [PATCH] Fix: filename suffix bulletins --- app/scodoc/sco_bulletins.py | 2 +- app/scodoc/sco_groups.py | 2 +- app/scodoc/sco_utils.py | 6 +++--- sco_version.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/scodoc/sco_bulletins.py b/app/scodoc/sco_bulletins.py index 8a4d465c..428ac4e2 100644 --- a/app/scodoc/sco_bulletins.py +++ b/app/scodoc/sco_bulletins.py @@ -945,7 +945,7 @@ def formsemestre_bulletinetud( )[0] if format not in {"html", "pdfmail"}: - filename = scu.bul_filename(formsemestre, etud, format) + filename = scu.bul_filename(formsemestre, etud) mime, suffix = scu.get_mime_suffix(format) return scu.send_file(bulletin, filename, mime=mime, suffix=suffix) elif format == "pdfmail": diff --git a/app/scodoc/sco_groups.py b/app/scodoc/sco_groups.py index e2560145..932c014a 100644 --- a/app/scodoc/sco_groups.py +++ b/app/scodoc/sco_groups.py @@ -1523,7 +1523,7 @@ def create_etapes_partition(formsemestre_id, partition_name="apo_etapes"): ) partition: Partition = db.session.get(Partition, pid) groups = partition.groups - groups_by_names = {g["group_name"]: g for g in groups} + groups_by_names = {g.group_name: g for g in groups} for etape in etapes: if etape not in groups_by_names: new_group = create_group(pid, etape) diff --git a/app/scodoc/sco_utils.py b/app/scodoc/sco_utils.py index 1a1643a3..d42774df 100644 --- a/app/scodoc/sco_utils.py +++ b/app/scodoc/sco_utils.py @@ -660,10 +660,10 @@ def bul_filename_old(sem: dict, etud: dict, format): return filename -def bul_filename(formsemestre, etud, format): - """Build a filename for this bulletin""" +def bul_filename(formsemestre, etud): + """Build a filename for this bulletin (without suffix)""" dt = time.strftime("%Y-%m-%d") - filename = f"bul-{formsemestre.titre_num()}-{dt}-{etud.nom}.{format}" + filename = f"bul-{formsemestre.titre_num()}-{dt}-{etud.nom}" filename = make_filename(filename) return filename diff --git a/sco_version.py b/sco_version.py index 786c8987..fa162ac9 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.5.0" +SCOVERSION = "9.5.1" SCONAME = "ScoDoc"