Meilleur msg erreur si manque ECTS

This commit is contained in:
Emmanuel Viennet 2022-03-29 10:26:44 +02:00
parent 501d43f709
commit 2d2d62fb71
2 changed files with 14 additions and 3 deletions

View File

@ -8,7 +8,7 @@
""" """
from functools import cached_property from functools import cached_property
from flask import g, flash from flask import flash, g, Markup, url_for
from app import log from app import log
from app.comp import moy_sem from app.comp import moy_sem
@ -123,8 +123,19 @@ class NotesTableCompat(ResultatsSemestre):
if check_apc_ects and self.is_apc and not hasattr(g, "checked_apc_ects"): if check_apc_ects and self.is_apc and not hasattr(g, "checked_apc_ects"):
g.checked_apc_ects = True g.checked_apc_ects = True
if None in [ue.ects for ue in ues if ue.type != UE_SPORT]: if None in [ue.ects for ue in ues if ue.type != UE_SPORT]:
formation = self.formsemestre.formation
ue_sans_ects = [
ue for ue in ues if ue.type != UE_SPORT and ue.ects is None
]
flash( flash(
"""Calcul moyenne générale impossible: ECTS des UE manquants !""", Markup(
f"""Calcul moyenne générale impossible: ECTS des UE manquants !<br>
(dans {' ,'.join([ue.acronyme for ue in ue_sans_ects])}
de la formation: <a href="{url_for("notes.ue_table",
scodoc_dept=g.scodoc_dept, formation_id=formation.id)}">{formation.get_titre_version()}</a>)
)
"""
),
category="danger", category="danger",
) )
return ues_dict return ues_dict

View File

@ -1,7 +1,7 @@
# -*- mode: python -*- # -*- mode: python -*-
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
SCOVERSION = "9.1.87" SCOVERSION = "9.1.88"
SCONAME = "ScoDoc" SCONAME = "ScoDoc"