Skip to content
Snippets Groups Projects
Commit b6211c80 authored by Emmanuel Viennet's avatar Emmanuel Viennet
Browse files

Fix bilan_ues (UEs sans semestre_idx)

parent 2093a7f3
No related branches found
No related tags found
No related merge requests found
......@@ -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}",
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment