- BUT: affichage UE validées si décision de jury présente sur le semestre.

- BUT: ordre d'affichage (json) des décisions d'UE dans les bulletins.
- Bug calcul champs (situation, ...) des bulletins.
This commit is contained in:
Emmanuel Viennet 2022-09-14 21:44:38 +02:00
parent dae464ea28
commit 1d4b328a8e
6 changed files with 22 additions and 14 deletions

View File

@ -435,7 +435,7 @@ class BulletinBUT:
decision_ue=decisions_ues.get(ue.id, {}), decision_ue=decisions_ues.get(ue.id, {}),
etud_groups=etud_groups, 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[ue.acronyme] = ue_r
d["ues"] = d_ues d["ues"] = d_ues

View File

@ -9,7 +9,7 @@
import pandas as pd import pandas as pd
from app import db 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.comp.res_cache import ResultatsCache
from app.scodoc import sco_cache from app.scodoc import sco_cache
from app.scodoc import sco_codes_parcours from app.scodoc import sco_codes_parcours
@ -68,7 +68,7 @@ class ValidationsSemestre(ResultatsCache):
) )
decisions_jury = {} decisions_jury = {}
for decision in decisions_jury_q.filter( 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] = { decisions_jury[decision.etudid] = {
"code": decision.code, "code": decision.code,
@ -78,15 +78,18 @@ class ValidationsSemestre(ResultatsCache):
} }
self.decisions_jury = decisions_jury self.decisions_jury = decisions_jury
# UEs: # UEs: { etudid : { ue_id : {"code":, "ects":, "event_date":} }}
decisions_jury_ues = {} decisions_jury_ues = {}
for decision in decisions_jury_q.filter( # Parcours les décisions d'UE:
ScolarFormSemestreValidation.ue_id != None # slt dec. sem. 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: if decision.etudid not in decisions_jury_ues:
decisions_jury_ues[decision.etudid] = {} decisions_jury_ues[decision.etudid] = {}
# Calcul des ECTS associés à cette UE: # 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 ects = decision.ue.ects or 0.0 # 0 if None
else: else:
ects = 0.0 ects = 0.0

View File

@ -867,7 +867,7 @@ def _format_situation_fields(
for field_name in field_names: for field_name in field_names:
field = infos.get(field_name, "") field = infos.get(field_name, "")
if field and not field.endswith("."): if field and not field.endswith("."):
infos[field_name] = "." infos[field_name] += "."
# ------ Page bulletin # ------ Page bulletin

View File

@ -98,10 +98,15 @@ def _descr_decisions_ues(nt, etudid, decisions_ue, decision_sem) -> list[dict]:
if decisions_ue[ue_id] and ( if decisions_ue[ue_id] and (
sco_codes_parcours.code_ue_validant(decisions_ue[ue_id]["code"]) sco_codes_parcours.code_ue_validant(decisions_ue[ue_id]["code"])
or ( or (
(not nt.is_apc)
and (
# XXX ceci devrait dépendre du parcours et non pas être une option ! #sco8 # XXX ceci devrait dépendre du parcours et non pas être une option ! #sco8
decision_sem decision_sem
and scu.CONFIG.CAPITALIZE_ALL_UES and scu.CONFIG.CAPITALIZE_ALL_UES
and sco_codes_parcours.code_semestre_validant(decision_sem["code"]) and sco_codes_parcours.code_semestre_validant(
decision_sem["code"]
)
)
) )
): ):
ue = sco_edit_ue.ue_list(args={"ue_id": ue_id})[0] ue = sco_edit_ue.ue_list(args={"ue_id": ue_id})[0]

View File

@ -1052,7 +1052,7 @@ def query_portal(req, msg="Portail Apogee", timeout=3):
except requests.TooManyRedirects: except requests.TooManyRedirects:
error_message = "TooManyRedirects" error_message = "TooManyRedirects"
except requests.RequestException: except requests.RequestException:
error_message = "can't connect to {msg}" error_message = f"can't connect to {msg}"
if error_message is not None: if error_message is not None:
log(f"query_portal: {error_message}") log(f"query_portal: {error_message}")
return "" return ""

View File

@ -1,7 +1,7 @@
# -*- mode: python -*- # -*- mode: python -*-
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
SCOVERSION = "9.3.37" SCOVERSION = "9.3.38"
SCONAME = "ScoDoc" SCONAME = "ScoDoc"