Fix: cas une seule UE capitalisée
This commit is contained in:
parent
8a06324629
commit
4bec9a1713
@ -152,7 +152,7 @@ class BulletinBUT:
|
||||
return {} # aucune capitalisation
|
||||
d = {}
|
||||
for _, ue_capitalisee in self.res.validations.ue_capitalisees.loc[
|
||||
etud.id
|
||||
[etud.id]
|
||||
].iterrows():
|
||||
if sco_codes_parcours.code_ue_validant(ue_capitalisee.code):
|
||||
ue = UniteEns.query.get(ue_capitalisee.ue_id) # XXX cacher ?
|
||||
|
@ -16,8 +16,9 @@ import pandas as pd
|
||||
from flask import g, url_for
|
||||
|
||||
from app.auth.models import User
|
||||
from app.comp.res_cache import ResultatsCache
|
||||
from app.comp import res_sem
|
||||
from app.comp.res_cache import ResultatsCache
|
||||
from app.comp.jury import ValidationsSemestre
|
||||
from app.comp.moy_mod import ModuleImplResults
|
||||
from app.models import FormSemestre, FormSemestreUECoef
|
||||
from app.models import Identite
|
||||
@ -171,6 +172,12 @@ class ResultatsSemestre(ResultatsCache):
|
||||
]
|
||||
|
||||
# --- JURY...
|
||||
def load_validations(self) -> ValidationsSemestre:
|
||||
"""Load validations, set attribute and return value"""
|
||||
if not self.validations:
|
||||
self.validations = res_sem.load_formsemestre_validations(self.formsemestre)
|
||||
return self.validations
|
||||
|
||||
def get_etud_ue_validables(self, etudid: int) -> list[UniteEns]:
|
||||
"""Liste des UEs du semestre qui doivent être validées
|
||||
|
||||
@ -229,8 +236,7 @@ class ResultatsSemestre(ResultatsCache):
|
||||
"""
|
||||
# Supposant qu'il y a peu d'UE capitalisées,
|
||||
# on recalcule les moyennes gen des etuds ayant des UE capitalisée.
|
||||
if not self.validations:
|
||||
self.validations = res_sem.load_formsemestre_validations(self.formsemestre)
|
||||
self.load_validations()
|
||||
ue_capitalisees = self.validations.ue_capitalisees
|
||||
for etudid in ue_capitalisees.index:
|
||||
recompute_mg = False
|
||||
|
@ -284,11 +284,8 @@ class NotesTableCompat(ResultatsSemestre):
|
||||
if self.get_etud_etat(etudid) == DEF:
|
||||
return {}
|
||||
else:
|
||||
if not self.validations:
|
||||
self.validations = res_sem.load_formsemestre_validations(
|
||||
self.formsemestre
|
||||
)
|
||||
return self.validations.decisions_jury_ues.get(etudid, None)
|
||||
validations = self.load_validations()
|
||||
return validations.decisions_jury_ues.get(etudid, None)
|
||||
|
||||
def get_etud_ects_valides(self, etudid: int, decisions_ues: dict = False) -> 0:
|
||||
"""Le total des ECTS validés (et enregistrés) par l'étudiant dans ce semestre.
|
||||
@ -314,11 +311,8 @@ class NotesTableCompat(ResultatsSemestre):
|
||||
"compense_formsemestre_id": None,
|
||||
}
|
||||
else:
|
||||
if not self.validations:
|
||||
self.validations = res_sem.load_formsemestre_validations(
|
||||
self.formsemestre
|
||||
)
|
||||
return self.validations.decisions_jury.get(etudid, None)
|
||||
validations = self.load_validations()
|
||||
return validations.decisions_jury.get(etudid, None)
|
||||
|
||||
def get_etud_mat_moy(self, matiere_id: int, etudid: int) -> str:
|
||||
"""moyenne d'un étudiant dans une matière (ou NA si pas de notes)"""
|
||||
|
Loading…
Reference in New Issue
Block a user