Fix bilan_ues (UEs sans semestre_idx)
This commit is contained in:
parent
2093a7f312
commit
b6211c80a6
@ -95,9 +95,10 @@ def get_ue_validation_by_niveau(
|
||||
validation.ue.id} pas de niveau de competence"""
|
||||
)
|
||||
continue
|
||||
semestre_idx = validation.ue.guess_semestre_idx()
|
||||
key = (
|
||||
validation.ue.niveau_competence.id,
|
||||
"impair" if validation.ue.semestre_idx % 2 else "pair",
|
||||
"impair" if semestre_idx % 2 else "pair",
|
||||
)
|
||||
existing = ue_validation_by_niveau.get(key, None)
|
||||
if (not existing) or (
|
||||
|
@ -168,6 +168,7 @@ class RowEtudWithUEs(RowEtudWithInfos):
|
||||
return
|
||||
best_validation = _best_validation(validations)
|
||||
moy_ue = best_validation.moy_ue
|
||||
ue_semestre_idx = best_validation.ue.guess_semestre_idx()
|
||||
note_class = ""
|
||||
if moy_ue is None:
|
||||
moy_ue = scu.NO_NOTE_STR
|
||||
@ -181,10 +182,10 @@ class RowEtudWithUEs(RowEtudWithInfos):
|
||||
raw_content=moy_ue,
|
||||
classes=[note_class],
|
||||
column_classes={"note_ue"},
|
||||
group=f"col_s{best_validation.ue.semestre_idx}",
|
||||
group=f"col_s{ue_semestre_idx}",
|
||||
)
|
||||
if self.table.is_apc:
|
||||
class_cursus = f"cursus_BUT{(best_validation.ue.semestre_idx+1)//2}"
|
||||
class_cursus = f"cursus_BUT{(ue_semestre_idx+1)//2}"
|
||||
else:
|
||||
class_cursus = ""
|
||||
self.add_cell(
|
||||
@ -192,5 +193,5 @@ class RowEtudWithUEs(RowEtudWithInfos):
|
||||
self.table.ue_titles[key],
|
||||
best_validation.code,
|
||||
column_classes={"code_ue", class_cursus},
|
||||
group=f"col_s{best_validation.ue.semestre_idx}",
|
||||
group=f"col_s{ue_semestre_idx}",
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user