Corrige édition coefs BUT

This commit is contained in:
Emmanuel Viennet 2023-05-14 15:00:39 +02:00 committed by iziram
parent 154e0e5cab
commit aae94b4f10
1 changed files with 10 additions and 3 deletions

View File

@ -85,7 +85,14 @@ def table_modules_ue_coefs(formation_id, semestre_idx=None, parcours_id: int = N
modules = [
mod
for mod in modules
if (parcours_id in (p.id for p in mod.parcours)) or (mod.parcours is None)
if ((parcours_id in (p.id for p in mod.parcours)) or (mod.parcours is None))
and mod.module_type in (scu.ModuleType.RESSOURCE, scu.ModuleType.SAE)
]
else: # ne montre que les ressources et SAE (pas le bonus...)
modules = [
mod
for mod in modules
if mod.module_type in (scu.ModuleType.RESSOURCE, scu.ModuleType.SAE)
]
# Titre des modules, en ligne
col_titres_mods = [
@ -119,8 +126,8 @@ def table_modules_ue_coefs(formation_id, semestre_idx=None, parcours_id: int = N
# met en gris les coefs qui devraient être nuls
# car le module n'est pas dans le parcours de l'UE:
if (
(mod.parcours is not None)
and (ue.parcours)
mod.parcours
and ue.parcours
and not {p.id for p in ue.parcours}.intersection(mod_parcours_ids)
):
cell_style = style + " champs_coef_hors_parcours"