From 1d4b328a8ecabdb996da5092e32b41aa588ad6ba Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Wed, 14 Sep 2022 21:44:38 +0200 Subject: [PATCH] =?UTF-8?q?-=20BUT:=20affichage=20UE=20valid=C3=A9es=20si?= =?UTF-8?q?=20d=C3=A9cision=20de=20jury=20pr=C3=A9sente=20sur=20le=20semes?= =?UTF-8?q?tre.=20-=20BUT:=20ordre=20d'affichage=20(json)=20des=20d=C3=A9c?= =?UTF-8?q?isions=20d'UE=20dans=20les=20bulletins.=20-=20Bug=20calcul=20ch?= =?UTF-8?q?amps=20(situation,=20...)=20des=20bulletins.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/but/bulletin_but.py | 2 +- app/comp/jury.py | 15 +++++++++------ app/scodoc/sco_bulletins.py | 2 +- app/scodoc/sco_pvjury.py | 13 +++++++++---- app/scodoc/sco_utils.py | 2 +- sco_version.py | 2 +- 6 files changed, 22 insertions(+), 14 deletions(-) diff --git a/app/but/bulletin_but.py b/app/but/bulletin_but.py index 891625e5df..506f8754e4 100644 --- a/app/but/bulletin_but.py +++ b/app/but/bulletin_but.py @@ -435,7 +435,7 @@ class BulletinBUT: decision_ue=decisions_ues.get(ue.id, {}), etud_groups=etud_groups, ) - if ue_r: # exclu UE soprt sans inscriptions + if ue_r: # exclu UE sport sans inscriptions d_ues[ue.acronyme] = ue_r d["ues"] = d_ues diff --git a/app/comp/jury.py b/app/comp/jury.py index f7174d4258..cad1b2a56b 100644 --- a/app/comp/jury.py +++ b/app/comp/jury.py @@ -9,7 +9,7 @@ import pandas as pd from app import db -from app.models import FormSemestre, ScolarFormSemestreValidation +from app.models import FormSemestre, ScolarFormSemestreValidation, UniteEns from app.comp.res_cache import ResultatsCache from app.scodoc import sco_cache from app.scodoc import sco_codes_parcours @@ -68,7 +68,7 @@ class ValidationsSemestre(ResultatsCache): ) decisions_jury = {} for decision in decisions_jury_q.filter( - ScolarFormSemestreValidation.ue_id == None # slt dec. sem. + db.text("ue_id is NULL") # slt dec. sem. ): decisions_jury[decision.etudid] = { "code": decision.code, @@ -78,15 +78,18 @@ class ValidationsSemestre(ResultatsCache): } self.decisions_jury = decisions_jury - # UEs: + # UEs: { etudid : { ue_id : {"code":, "ects":, "event_date":} }} decisions_jury_ues = {} - for decision in decisions_jury_q.filter( - ScolarFormSemestreValidation.ue_id != None # slt dec. sem. + # Parcours les décisions d'UE: + for decision in ( + decisions_jury_q.filter(db.text("ue_id is not NULL")) + .join(UniteEns) + .order_by(UniteEns.numero) ): if decision.etudid not in decisions_jury_ues: decisions_jury_ues[decision.etudid] = {} # Calcul des ECTS associés à cette UE: - if sco_codes_parcours.code_ue_validant(decision.code): + if sco_codes_parcours.code_ue_validant(decision.code) and decision.ue: ects = decision.ue.ects or 0.0 # 0 if None else: ects = 0.0 diff --git a/app/scodoc/sco_bulletins.py b/app/scodoc/sco_bulletins.py index ba7618b7b8..ceb1a8c385 100644 --- a/app/scodoc/sco_bulletins.py +++ b/app/scodoc/sco_bulletins.py @@ -867,7 +867,7 @@ def _format_situation_fields( for field_name in field_names: field = infos.get(field_name, "") if field and not field.endswith("."): - infos[field_name] = "." + infos[field_name] += "." # ------ Page bulletin diff --git a/app/scodoc/sco_pvjury.py b/app/scodoc/sco_pvjury.py index 140234f596..27427aebca 100644 --- a/app/scodoc/sco_pvjury.py +++ b/app/scodoc/sco_pvjury.py @@ -98,10 +98,15 @@ def _descr_decisions_ues(nt, etudid, decisions_ue, decision_sem) -> list[dict]: if decisions_ue[ue_id] and ( sco_codes_parcours.code_ue_validant(decisions_ue[ue_id]["code"]) or ( - # XXX ceci devrait dépendre du parcours et non pas être une option ! #sco8 - decision_sem - and scu.CONFIG.CAPITALIZE_ALL_UES - and sco_codes_parcours.code_semestre_validant(decision_sem["code"]) + (not nt.is_apc) + and ( + # XXX ceci devrait dépendre du parcours et non pas être une option ! #sco8 + decision_sem + and scu.CONFIG.CAPITALIZE_ALL_UES + and sco_codes_parcours.code_semestre_validant( + decision_sem["code"] + ) + ) ) ): ue = sco_edit_ue.ue_list(args={"ue_id": ue_id})[0] diff --git a/app/scodoc/sco_utils.py b/app/scodoc/sco_utils.py index b7304c1e95..ce36185eea 100644 --- a/app/scodoc/sco_utils.py +++ b/app/scodoc/sco_utils.py @@ -1052,7 +1052,7 @@ def query_portal(req, msg="Portail Apogee", timeout=3): except requests.TooManyRedirects: error_message = "TooManyRedirects" except requests.RequestException: - error_message = "can't connect to {msg}" + error_message = f"can't connect to {msg}" if error_message is not None: log(f"query_portal: {error_message}") return "" diff --git a/sco_version.py b/sco_version.py index b23b6c3f81..2faa78ebd7 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.3.37" +SCOVERSION = "9.3.38" SCONAME = "ScoDoc"