diff --git a/app/scodoc/sco_formsemestre_inscriptions.py b/app/scodoc/sco_formsemestre_inscriptions.py index 2c99c685f..8236f2ab7 100644 --- a/app/scodoc/sco_formsemestre_inscriptions.py +++ b/app/scodoc/sco_formsemestre_inscriptions.py @@ -34,7 +34,7 @@ from flask import flash, url_for, g, request from app.comp import res_sem from app.comp.res_compat import NotesTableCompat -from app.models import FormSemestre, FormSemestreInscription +from app.models import Formation, FormSemestre, FormSemestreInscription from app.models.etudiants import Identite from app.models.groups import GroupDescr import app.scodoc.sco_utils as scu @@ -317,50 +317,63 @@ def formsemestre_inscription_with_modules_form(etudid, only_ext=False): """Formulaire inscription de l'etud dans l'un des semestres existants. Si only_ext, ne montre que les semestre extérieurs. """ - etud = sco_etud.get_etud_info(etudid=etudid, filled=True)[0] + etud: Identite = Identite.query.filter_by( + id=etudid, dept_id=g.scodoc_dept_id + ).first_or_404() H = [ html_sco_header.sco_header(), - "
L'étudiant sera inscrit à tous les modules du semestre +
L'étudiant sera inscrit à tous les modules du semestre choisi (sauf Sport & Culture).
aucune session de formation !
") H.append( - 'Etudiant%s non inscrit%s" % (info["ne"], info["ne"])] + l = [f"""
Étudiant{info["ne"]} non inscrit{info["ne"]}"""] if authuser.has_permission(Permission.ScoEtudInscrit): l.append( - 'inscrire' - % (scu.ScoURL(), etudid) + f"""inscrire""" ) l.append("") info["liste_inscriptions"] = "\n".join(l) diff --git a/app/views/scolar.py b/app/views/scolar.py index ffd5a0807..ed8e93d72 100644 --- a/app/views/scolar.py +++ b/app/views/scolar.py @@ -740,26 +740,26 @@ def doSuppressAnnotation(etudid, annotation_id): ) -@bp.route("/formChangeCoordonnees", methods=["GET", "POST"]) +@bp.route("/form_change_coordonnees", methods=["GET", "POST"]) @scodoc @permission_required(Permission.ScoEtudChangeAdr) @scodoc7func -def formChangeCoordonnees(etudid): +def form_change_coordonnees(etudid): "edit coordonnees etudiant" + etud = Identite.query.get_or_404(etudid) cnx = ndb.GetDBConnexion() - etud = sco_etud.get_etud_info(filled=True, etudid=etudid)[0] adrs = sco_etud.adresse_list(cnx, {"etudid": etudid}) if adrs: adr = adrs[0] else: adr = {} # no data for this student H = [ - '
' - % etud + f"""{html_sco_header.sco_header( + page_title=f"Changement coordonnées de {etud.nomprenom}" + )} +
""" ] - header = html_sco_header.sco_header( - page_title="Changement adresse de %(nomprenom)s" % etud - ) tf = TrivialFormulator( request.base_url, @@ -799,7 +799,7 @@ def formChangeCoordonnees(etudid): ) dest_url = url_for("scolar.ficheEtud", scodoc_dept=g.scodoc_dept, etudid=etudid) if tf[0] == 0: - return header + "\n".join(H) + tf[1] + html_sco_header.sco_footer() + return "\n".join(H) + tf[1] + html_sco_header.sco_footer() elif tf[0] == -1: return flask.redirect(dest_url) else: