diff --git a/app/scodoc/sco_cost_formation.py b/app/scodoc/sco_cost_formation.py index 16429881b8..334d3a0a0c 100644 --- a/app/scodoc/sco_cost_formation.py +++ b/app/scodoc/sco_cost_formation.py @@ -34,8 +34,6 @@ from flask import request from app.models import FormSemestre from app.scodoc.gen_tables import GenTable -from app.scodoc import sco_formsemestre -from app.scodoc import sco_moduleimpl from app.scodoc import sco_preferences import app.scodoc.sco_utils as scu import sco_version @@ -65,16 +63,18 @@ def formsemestre_table_estim_cost( { "code": modimpl.module.code or "", "titre": modimpl.module.titre, - "heures_cours": modimpl.module.heures_cours, - "heures_td": modimpl.module.heures_td * n_group_td, - "heures_tp": modimpl.module.heures_tp * n_group_tp, + "heures_cours": modimpl.module.heures_cours or 0.0, + "heures_td": (modimpl.module.heures_td or 0.0) * n_group_td, + "heures_tp": (modimpl.module.heures_tp or 0.0) * n_group_tp, } ) # calcul des heures: - for t in rows: - t["HeqTD"] = ( - t["heures_td"] + coef_cours * t["heures_cours"] + coef_tp * t["heures_tp"] + for row in rows: + row["HeqTD"] = ( + row["heures_td"] + + coef_cours * row["heures_cours"] + + coef_tp * row["heures_tp"] ) sum_cours = sum([t["heures_cours"] for t in rows]) sum_td = sum([t["heures_td"] for t in rows])