From 770134bb3d2596ba8e88f24244e00d23a31ed055 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 10 Sep 2024 23:16:27 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20validations=20UE=20ant=C3=A9rieur=20/=20?= =?UTF-8?q?template?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/but/cursus_but.py | 8 ++++---- app/models/etudiants.py | 2 +- app/scodoc/sco_formsemestre_validation.py | 5 ++++- app/templates/sco_page.j2 | 4 +--- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/but/cursus_but.py b/app/but/cursus_but.py index 8d9a7ba47..6afa8f82e 100644 --- a/app/but/cursus_but.py +++ b/app/but/cursus_but.py @@ -447,11 +447,11 @@ def validations_count_ects(validations: list[ScolarFormSemestreValidation]) -> i doublons (niveaux de compétences validés plusieurs fois)""" ects_dict = {} for v in validations: - key = ( - v.ue.semestre_idx, - v.ue.niveau_competence.id if v.ue.niveau_competence else None, - ) if v.code in CODES_UE_VALIDES: + key = ( + v.ue.semestre_idx, + v.ue.niveau_competence.id if v.ue.niveau_competence else None, + ) ects_dict[key] = v.ue.ects or 0.0 return int(sum(ects_dict.values())) if ects_dict else 0 diff --git a/app/models/etudiants.py b/app/models/etudiants.py index af2207df6..e52e3cf68 100644 --- a/app/models/etudiants.py +++ b/app/models/etudiants.py @@ -216,7 +216,7 @@ class Identite(models.ScoDocModel): except (TypeError, ValueError): if accept_none: return None - abort(404, "etudid invalide") + abort(404, f"etudid invalide {request.url if request else ''}") query = ( cls.query.filter_by(id=etudid, dept_id=g.scodoc_dept_id) diff --git a/app/scodoc/sco_formsemestre_validation.py b/app/scodoc/sco_formsemestre_validation.py index 0050396a4..675abed9e 100644 --- a/app/scodoc/sco_formsemestre_validation.py +++ b/app/scodoc/sco_formsemestre_validation.py @@ -61,6 +61,7 @@ from app.scodoc import sco_cursus_dut from app.scodoc.sco_cursus_dut import etud_est_inscrit_ue from app.scodoc import sco_preferences from app.scodoc import sco_pv_dict +from app.views import ScoData # ------------------------------------------------------------------------------------ @@ -1219,6 +1220,7 @@ def formsemestre_validate_previous_ue(formsemestre: FormSemestre, etud: Identite "min_value": 0, "max_value": 20, "title": "Moyenne (/20) obtenue dans cette UE:", + "explanation": "mettre 10 si non notée", }, ), ( @@ -1249,6 +1251,7 @@ def formsemestre_validate_previous_ue(formsemestre: FormSemestre, etud: Identite cssstyles=["css/jury_delete_manual.css"], etudid=etud.id, formsemestre_id=formsemestre.id, + sco=ScoData(etud=etud, formsemestre=formsemestre), content=f"""

Gestion des validations d'UEs antérieures de {etud.html_link_fiche()} @@ -1401,7 +1404,7 @@ def do_formsemestre_validate_previous_ue( semestre_id=semestre_id, is_external=True, ) - + log(f"formsemestre_validate_previous_ue: etudid={etudid}, ue={ue}, code={code}") Scolog.logdb( method="formsemestre_validate_previous_ue", etudid=etudid, diff --git a/app/templates/sco_page.j2 b/app/templates/sco_page.j2 index 553a39070..6ba98544a 100644 --- a/app/templates/sco_page.j2 +++ b/app/templates/sco_page.j2 @@ -38,17 +38,15 @@ toggle sidebar + {% include "flashed_messages.j2" %} {% if sco.formsemestre %}
- {% include "flashed_messages.j2" %} {% if sco.formsemestre %} {% block formsemestre_header %} {% include "formsemestre_header.j2" %} {% endblock %} {% endif %}
- {% else %} - {% include "flashed_messages.j2" %} {% endif %}