diff --git a/app/scodoc/sco_formsemestre_status.py b/app/scodoc/sco_formsemestre_status.py index 995d9f878e..ae206a5cdb 100644 --- a/app/scodoc/sco_formsemestre_status.py +++ b/app/scodoc/sco_formsemestre_status.py @@ -35,12 +35,12 @@ from flask import url_for from flask_login import current_user from app import log +from app.models import Module import app.scodoc.sco_utils as scu from app.scodoc.sco_utils import ModuleType import app.scodoc.notesdb as ndb from app.scodoc.sco_permissions import Permission from app.scodoc.sco_exceptions import ScoValueError, ScoInvalidDateError -import sco_version from app.scodoc import html_sco_header from app.scodoc import htmlutils from app.scodoc import sco_abs @@ -63,6 +63,7 @@ from app.scodoc import sco_preferences from app.scodoc import sco_users from app.scodoc.gen_tables import GenTable from app.scodoc.sco_formsemestre_custommenu import formsemestre_custommenu_html +import sco_version def _build_menu_stats(formsemestre_id): @@ -1112,13 +1113,19 @@ def formsemestre_tableau_modules( H = [] prev_ue_id = None for modimpl in modimpls: - mod = modimpl["module"] - mod_descr = ( - "Module " - + modimpl["module"]["titre"] - + ", coef. " - + str(modimpl["module"]["coefficient"]) - ) + # mod = modimpl["module"] + mod = Module.query.get(modimpl["module_id"]) + mod_descr = "Module " + mod.titre + if mod.is_apc(): + coef_descr = ", ".join( + [f"{ue_acro}: {co}" for ue_acro, co in mod.ue_coefs_descr()] + ) + if coef_descr: + mod_descr += "coefs: " + coef_descr + else: + mod_descr += " (pas de coefficients) " + else: + mod_descr += ", coef. " + str(mod.coefficient) mod_ens = sco_users.user_info(modimpl["responsable_id"])["nomcomplet"] if modimpl["ens"]: mod_ens += " (resp.), " + ", ".join( @@ -1185,11 +1192,11 @@ def formsemestre_tableau_modules( H.append( '