forked from ScoDoc/ScoDoc
Fix: traitement erreur si code étape Apo invalide + ajout total ECTS sur fiche
This commit is contained in:
parent
09d59848d6
commit
853bc31422
@ -36,7 +36,7 @@ import sqlalchemy as sa
|
||||
|
||||
from app import log
|
||||
from app.auth.models import User
|
||||
from app.but import cursus_but
|
||||
from app.but import cursus_but, validations_view
|
||||
from app.models import Adresse, EtudAnnotation, FormSemestre, Identite, ScoDocSiteConfig
|
||||
from app.scodoc import (
|
||||
codes_cursus,
|
||||
@ -445,6 +445,14 @@ def fiche_etud(etudid=None):
|
||||
# Liens vers compétences BUT
|
||||
if last_formsemestre and last_formsemestre.formation.is_apc():
|
||||
but_cursus = cursus_but.EtudCursusBUT(etud, last_formsemestre.formation)
|
||||
refcomp = last_formsemestre.formation.referentiel_competence
|
||||
if refcomp:
|
||||
ue_validation_by_niveau = validations_view.get_ue_validation_by_niveau(
|
||||
refcomp, etud
|
||||
)
|
||||
ects_total = sum((v.ects() for v in ue_validation_by_niveau.values()))
|
||||
else:
|
||||
ects_total = ""
|
||||
info[
|
||||
"but_cursus_mkup"
|
||||
] = f"""
|
||||
@ -454,15 +462,20 @@ def fiche_etud(etudid=None):
|
||||
cursus=but_cursus,
|
||||
scu=scu,
|
||||
)}
|
||||
<div class="link_validation_rcues">
|
||||
<a class="stdlink" href="{url_for("notes.validation_rcues",
|
||||
scodoc_dept=g.scodoc_dept, etudid=etudid,
|
||||
formsemestre_id=last_formsemestre.id)}"
|
||||
title="Visualiser les compétences BUT"
|
||||
>
|
||||
<img src="/ScoDoc/static/icons/parcours-but.png" alt="validation_rcues" height="100px"/>
|
||||
<div>Compétences BUT</div>
|
||||
</a>
|
||||
<div class="fiche_but_col2">
|
||||
<div class="link_validation_rcues">
|
||||
<a class="stdlink" href="{url_for("notes.validation_rcues",
|
||||
scodoc_dept=g.scodoc_dept, etudid=etudid,
|
||||
formsemestre_id=last_formsemestre.id)}"
|
||||
title="Visualiser les compétences BUT"
|
||||
>
|
||||
<img src="/ScoDoc/static/icons/parcours-but.png" alt="validation_rcues" height="100px"/>
|
||||
<div style="text-align: center;">Compétences BUT</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="fiche_total_etcs">
|
||||
Total ECTS BUT: {ects_total:g}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
"""
|
||||
|
@ -25,12 +25,14 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
"""Classe stockant le VDI avec le code étape (noms de fichiers maquettes et code semestres)
|
||||
"""Apogée: gestion du VDI avec le code étape (noms de fichiers maquettes et code semestres)
|
||||
"""
|
||||
from app.scodoc.sco_exceptions import ScoValueError
|
||||
|
||||
|
||||
class ApoEtapeVDI(object):
|
||||
"""Classe stockant le VDI avec le code étape (noms de fichiers maquettes et code semestres)"""
|
||||
|
||||
_ETAPE_VDI_SEP = "!"
|
||||
|
||||
def __init__(self, etape_vdi: str = None, etape: str = "", vdi: str = ""):
|
||||
@ -110,7 +112,8 @@ class ApoEtapeVDI(object):
|
||||
elif len(t) == 2:
|
||||
etape, vdi = t
|
||||
else:
|
||||
raise ValueError("invalid code etape")
|
||||
# code étape invalide
|
||||
etape, vdi = "", ""
|
||||
return etape, vdi
|
||||
else:
|
||||
return etape_vdi, ""
|
||||
|
@ -962,10 +962,18 @@ td.fichetitre2 .fl {
|
||||
div.section_but {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
align-items: flex-end;
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
|
||||
div.fiche_but_col2 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
div.fiche_total_etcs {
|
||||
font-weight: bold;
|
||||
margin-top: 16px;
|
||||
}
|
||||
div.section_but > div.link_validation_rcues {
|
||||
align-self: center;
|
||||
text-align: center;
|
||||
|
Loading…
Reference in New Issue
Block a user