diff --git a/app/comp/moy_ue.py b/app/comp/moy_ue.py index 30d8466b4d..071d72e81d 100644 --- a/app/comp/moy_ue.py +++ b/app/comp/moy_ue.py @@ -394,7 +394,10 @@ def compute_ue_moys_classic( if sco_preferences.get_preference("use_ue_coefs", formsemestre.id): # Cas avec coefficients d'UE forcés: (on met à zéro l'UE bonus) etud_coef_ue_df = pd.DataFrame( - {ue.id: ue.coefficient if ue.type != UE_SPORT else 0.0 for ue in ues}, + { + ue.id: (ue.coefficient or 0.0) if ue.type != UE_SPORT else 0.0 + for ue in ues + }, index=modimpl_inscr_df.index, columns=[ue.id for ue in ues], ) diff --git a/app/scodoc/sco_formsemestre_status.py b/app/scodoc/sco_formsemestre_status.py index 2e572ea309..d375a47d0b 100755 --- a/app/scodoc/sco_formsemestre_status.py +++ b/app/scodoc/sco_formsemestre_status.py @@ -50,6 +50,7 @@ from app.models import ( ModuleImpl, NotesNotes, ) +from app.scodoc.codes_cursus import UE_SPORT import app.scodoc.sco_utils as scu from app.scodoc.sco_utils import ModuleType from app.scodoc.sco_permissions import Permission @@ -60,7 +61,6 @@ from app.scodoc.sco_exceptions import ( ) from app.scodoc import html_sco_header from app.scodoc import htmlutils -from app.scodoc import sco_abs from app.scodoc import sco_archives from app.scodoc import sco_bulletins from app.scodoc import codes_cursus @@ -660,9 +660,11 @@ def formsemestre_description_table( "Module": ue.titre, "_css_row_class": "table_row_ue", } - if use_ue_coefs: - ue_info["Coef."] = ue.coefficient - ue_info["Coef._class"] = "ue_coef" + if use_ue_coefs and ue.type != UE_SPORT: + ue_info["Coef."] = ue.coefficient or "0." + ue_info["_Coef._class"] = "ue_coef" + if not ue.coefficient: + ue_info["_Coef._class"] += " ue_coef_nul" if ue.color: for k in list(ue_info.keys()): if not k.startswith("_"): diff --git a/app/static/css/scodoc.css b/app/static/css/scodoc.css index df293cf7d0..92d00c3769 100644 --- a/app/static/css/scodoc.css +++ b/app/static/css/scodoc.css @@ -2472,6 +2472,12 @@ span.ue_type { margin-right: 1.5em; } +table.formsemestre_description td.ue_coef_nul { + background-color: yellow!important; + color: red; + font-weight: bold; +} + ul.notes_module_list span.ue_coefs_list { color: blue; font-size: 70%;