diff --git a/app/scodoc/sco_edit_ue.py b/app/scodoc/sco_edit_ue.py index 9d9eadf51..d581bb658 100644 --- a/app/scodoc/sco_edit_ue.py +++ b/app/scodoc/sco_edit_ue.py @@ -643,7 +643,7 @@ def ue_table(formation_id=None, semestre_idx=1, msg=""): # was ue_list parcours = formation.get_parcours() is_apc = parcours.APC_SAE locked = formation.has_locked_sems() - if semestre_idx == "all": + if semestre_idx == "all" or semestre_idx == "": semestre_idx = None else: semestre_idx = int(semestre_idx) diff --git a/app/scodoc/sco_page_etud.py b/app/scodoc/sco_page_etud.py index 259bbe333..2bc1cc7a1 100644 --- a/app/scodoc/sco_page_etud.py +++ b/app/scodoc/sco_page_etud.py @@ -30,7 +30,7 @@ Fiche description d'un étudiant et de son parcours """ -from flask import url_for, g, request +from flask import abort, url_for, g, request from flask_login import current_user import app.scodoc.sco_utils as scu @@ -582,24 +582,23 @@ def etud_info_html(etudid, with_photo="1", debug=False): """ formsemestre_id = sco_formsemestre_status.retreive_formsemestre_from_request() with_photo = int(with_photo) - etud = sco_etud.get_etud_info(filled=True)[0] + etuds = sco_etud.get_etud_info(filled=True) + if etuds: + etud = etuds[0] + else: + abort(404, "etudiant inconnu") photo_html = sco_photos.etud_photo_html(etud, title="fiche de " + etud["nom"]) # experimental: may be too slow to be here - etud["codeparcours"], etud["decisions_jury"] = sco_report.get_codeparcoursetud( - etud, prefix="S", separator=", " - ) + codeparcours, _ = sco_report.get_codeparcoursetud(etud, prefix="S", separator=", ") bac = sco_bac.Baccalaureat(etud["bac"], etud["specialite"]) - etud["bac_abbrev"] = bac.abbrev() - H = ( - """
+ bac_abbrev = bac.abbrev() + H = f"""
-
%(nomprenom)s
-
Bac: %(bac_abbrev)s
-
%(codeparcours)s
+
{etud["nomprenom"]}
+
Bac: {bac_abbrev}
+
{codeparcours}
""" - % etud - ) # Informations sur l'etudiant dans le semestre courant: sem = None @@ -610,7 +609,7 @@ def etud_info_html(etudid, with_photo="1", debug=False): if sem: groups = sco_groups.get_etud_groups(etudid, formsemestre_id) grc = sco_groups.listgroups_abbrev(groups) - H += '
En S%d: %s
' % (sem["semestre_id"], grc) + H += f"""
En S{sem["semestre_id"]}: {grc}
""" H += "
" # fin partie gauche (eid_left) if with_photo: H += '' + photo_html + ""