From 339d70edd2ba23c884ac0d780ce53f014fc7c938 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 18 Apr 2023 02:20:32 +0200 Subject: [PATCH] =?UTF-8?q?Apo:=20am=C3=A9liore=20changement=20p=C3=A9riod?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scodoc/sco_etape_apogee.py | 7 ++++--- app/scodoc/sco_etape_apogee_view.py | 16 ++++++++-------- app/scodoc/sco_semset.py | 14 ++++++++++---- sco_version.py | 2 +- 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/app/scodoc/sco_etape_apogee.py b/app/scodoc/sco_etape_apogee.py index ef60acca..be10eb23 100644 --- a/app/scodoc/sco_etape_apogee.py +++ b/app/scodoc/sco_etape_apogee.py @@ -143,9 +143,10 @@ def apo_csv_list_stored_archives(annee_scolaire=None, sem_id=None, etapes=None): if annee_scolaire: e = re.compile(str(annee_scolaire) + "-.+") oids = [x for x in oids if e.match(x)] - if sem_id: - e = re.compile(r"[0-9]{4}-" + str(sem_id)) - oids = [x for x in oids if e.match(x)] + # Note: ne filtre plus sur la période, afin que l'on puisse chnager le semset de période. + # if sem_id: + # e = re.compile(r"[0-9]{4}-" + str(sem_id)) + # oids = [x for x in oids if e.match(x)] infos = [] # liste d'infos for oid in oids: diff --git a/app/scodoc/sco_etape_apogee_view.py b/app/scodoc/sco_etape_apogee_view.py index b53fe5e0..e40cbe64 100644 --- a/app/scodoc/sco_etape_apogee_view.py +++ b/app/scodoc/sco_etape_apogee_view.py @@ -640,20 +640,20 @@ def view_apo_csv_store(semset_id="", csvfile=None, data: bytes = "", autodetect= apo_data = sco_apogee_csv.ApoData( data_str, periode=semset["sem_id"] ) # parse le fichier -> exceptions + dest_url = url_for( + "notes.apo_semset_maq_status", + scodoc_dept=g.scodoc_dept, + semset_id=semset_id, + ) if apo_data.etape not in semset["etapes"]: raise ScoValueError( - "Le code étape de ce fichier ne correspond pas à ceux de cet ensemble" + "Le code étape de ce fichier ne correspond pas à ceux de cet ensemble", + dest_url=dest_url, ) sco_etape_apogee.apo_csv_store(data_str, semset["annee_scolaire"], semset["sem_id"]) - return flask.redirect( - url_for( - "notes.apo_semset_maq_status", - scodoc_dept=g.scodoc_dept, - semset_id=semset_id, - ) - ) + return flask.redirect(dest_url) def view_apo_csv_download_and_store(etape_apo="", semset_id=""): diff --git a/app/scodoc/sco_semset.py b/app/scodoc/sco_semset.py index c91ee762..f8cf5e81 100644 --- a/app/scodoc/sco_semset.py +++ b/app/scodoc/sco_semset.py @@ -137,8 +137,15 @@ class SemSet(dict): self["semtitles"] = [sem["titre_num"] for sem in self.sems] # Construction du ou des lien(s) vers le semestre - pattern = '%(titreannee)s' - self["semlinks"] = [(pattern % sem) for sem in self.sems] + self["semlinks"] = [ + f"""{sem["titreannee"]} + """ + for sem in self.sems + ] + self["semtitles_str"] = "
".join(self["semlinks"]) def fill_formsemestres(self): @@ -364,8 +371,7 @@ class SemSet(dict): """ if sco_portal_apogee.has_portal(): return self.bilan.html_diagnostic() - else: - return "" + return "" def get_semsets_list(): diff --git a/sco_version.py b/sco_version.py index 26e724b0..f6d69c13 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.4.72" +SCOVERSION = "9.4.73" SCONAME = "ScoDoc"