1
0
forked from ScoDoc/ScoDoc

Fix: validations UE antérieur / template

This commit is contained in:
Emmanuel Viennet 2024-09-10 23:16:27 +02:00
parent 996df5f7b3
commit 770134bb3d
4 changed files with 10 additions and 9 deletions

View File

@ -447,11 +447,11 @@ def validations_count_ects(validations: list[ScolarFormSemestreValidation]) -> i
doublons (niveaux de compétences validés plusieurs fois)""" doublons (niveaux de compétences validés plusieurs fois)"""
ects_dict = {} ects_dict = {}
for v in validations: for v in validations:
if v.code in CODES_UE_VALIDES:
key = ( key = (
v.ue.semestre_idx, v.ue.semestre_idx,
v.ue.niveau_competence.id if v.ue.niveau_competence else None, v.ue.niveau_competence.id if v.ue.niveau_competence else None,
) )
if v.code in CODES_UE_VALIDES:
ects_dict[key] = v.ue.ects or 0.0 ects_dict[key] = v.ue.ects or 0.0
return int(sum(ects_dict.values())) if ects_dict else 0 return int(sum(ects_dict.values())) if ects_dict else 0

View File

@ -216,7 +216,7 @@ class Identite(models.ScoDocModel):
except (TypeError, ValueError): except (TypeError, ValueError):
if accept_none: if accept_none:
return None return None
abort(404, "etudid invalide") abort(404, f"etudid invalide {request.url if request else ''}")
query = ( query = (
cls.query.filter_by(id=etudid, dept_id=g.scodoc_dept_id) cls.query.filter_by(id=etudid, dept_id=g.scodoc_dept_id)

View File

@ -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.sco_cursus_dut import etud_est_inscrit_ue
from app.scodoc import sco_preferences from app.scodoc import sco_preferences
from app.scodoc import sco_pv_dict 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, "min_value": 0,
"max_value": 20, "max_value": 20,
"title": "Moyenne (/20) obtenue dans cette UE:", "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"], cssstyles=["css/jury_delete_manual.css"],
etudid=etud.id, etudid=etud.id,
formsemestre_id=formsemestre.id, formsemestre_id=formsemestre.id,
sco=ScoData(etud=etud, formsemestre=formsemestre),
content=f""" content=f"""
<h2 class="formsemestre">Gestion des validations d'UEs antérieures <h2 class="formsemestre">Gestion des validations d'UEs antérieures
de {etud.html_link_fiche()} de {etud.html_link_fiche()}
@ -1401,7 +1404,7 @@ def do_formsemestre_validate_previous_ue(
semestre_id=semestre_id, semestre_id=semestre_id,
is_external=True, is_external=True,
) )
log(f"formsemestre_validate_previous_ue: etudid={etudid}, ue={ue}, code={code}")
Scolog.logdb( Scolog.logdb(
method="formsemestre_validate_previous_ue", method="formsemestre_validate_previous_ue",
etudid=etudid, etudid=etudid,

View File

@ -38,17 +38,15 @@
<img id="toggle-sidebar-img" src="{{scu.STATIC_DIR}}/icons/back.svg" width="12px" alt="toggle sidebar"/> <img id="toggle-sidebar-img" src="{{scu.STATIC_DIR}}/icons/back.svg" width="12px" alt="toggle sidebar"/>
</div> </div>
</div> </div>
{% include "flashed_messages.j2" %}
{% if sco.formsemestre %} {% if sco.formsemestre %}
<div class="formsemestre-page-header"> <div class="formsemestre-page-header">
{% include "flashed_messages.j2" %}
{% if sco.formsemestre %} {% if sco.formsemestre %}
{% block formsemestre_header %} {% block formsemestre_header %}
{% include "formsemestre_header.j2" %} {% include "formsemestre_header.j2" %}
{% endblock %} {% endblock %}
{% endif %} {% endif %}
</div> </div>
{% else %}
{% include "flashed_messages.j2" %}
{% endif %} {% endif %}
<div id="sidebar"> <div id="sidebar">
{% include "sidebar.j2" %} {% include "sidebar.j2" %}