1
0
forked from ScoDoc/ScoDoc

ScoData arguments

This commit is contained in:
Emmanuel Viennet 2024-09-03 04:44:48 +02:00
parent 86fcc7cdf5
commit 0a1e16e81a
5 changed files with 17 additions and 16 deletions

View File

@ -67,7 +67,7 @@ def jury_delete_manual(etud: Identite):
), ),
rcue_vals=rcue_vals, rcue_vals=rcue_vals,
annee_but_vals=annee_but_vals, annee_but_vals=annee_but_vals,
sco=ScoData(), sco=ScoData(etud=etud),
title=f"Toutes les décisions de jury enregistrées pour {etud.html_link_fiche()}", title=f"Toutes les décisions de jury enregistrées pour {etud.html_link_fiche()}",
read_only=not current_user.has_permission(Permission.EtudInscrit), read_only=not current_user.has_permission(Permission.EtudInscrit),
) )

View File

@ -317,7 +317,7 @@ def ajout_assiduite_etud() -> str | Response:
form=form, form=form,
moduleimpl_id=moduleimpl_id, moduleimpl_id=moduleimpl_id,
redirect_url=redirect_url, redirect_url=redirect_url,
sco=ScoData(etud, formsemestre=formsemestre), sco=ScoData(etud=etud, formsemestre=formsemestre),
tableau=tableau, tableau=tableau,
scu=scu, scu=scu,
) )
@ -653,7 +653,7 @@ def bilan_etud():
assi_seuil=_get_seuil(), assi_seuil=_get_seuil(),
date_debut=date_debut, date_debut=date_debut,
date_fin=date_fin, date_fin=date_fin,
sco=ScoData(etud), sco=ScoData(etud=etud),
tableau=tableau[1], tableau=tableau[1],
) )
@ -747,7 +747,7 @@ def edit_justificatif_etud(justif_id: int):
nb_files=nb_files, nb_files=nb_files,
title=f"Modification justificatif absence de {justif.etudiant.html_link_fiche()}", title=f"Modification justificatif absence de {justif.etudiant.html_link_fiche()}",
redirect_url=redirect_url, redirect_url=redirect_url,
sco=ScoData(justif.etudiant), sco=ScoData(etud=justif.etudiant),
scu=scu, scu=scu,
readonly=not current_user.has_permission(Permission.AbsChange), readonly=not current_user.has_permission(Permission.AbsChange),
) )
@ -814,7 +814,7 @@ def ajout_justificatif_etud():
form=form, form=form,
title=f"Ajout justificatif absence pour {etud.html_link_fiche()}", title=f"Ajout justificatif absence pour {etud.html_link_fiche()}",
redirect_url=redirect_url, redirect_url=redirect_url,
sco=ScoData(etud), sco=ScoData(etud=etud),
scu=scu, scu=scu,
tableau=tableau, tableau=tableau,
) )
@ -1005,7 +1005,7 @@ def calendrier_assi_etud():
# Peuplement du template jinja # Peuplement du template jinja
return render_template( return render_template(
"assiduites/pages/calendrier_assi_etud.j2", "assiduites/pages/calendrier_assi_etud.j2",
sco=ScoData(etud), sco=ScoData(etud=etud),
annee=annee, annee=annee,
nonworkdays=_non_work_days(), nonworkdays=_non_work_days(),
annees=annees_str, annees=annees_str,
@ -1230,11 +1230,10 @@ def etat_abs_date():
fmt = request.args.get("fmt", "html") fmt = request.args.get("fmt", "html")
group_ids = request.args.getlist("group_ids", int) group_ids = request.args.getlist("group_ids", int)
evaluation_id = request.args.get("evaluation_id") evaluation_id = request.args.get("evaluation_id")
evaluation: Evaluation = ( evaluation = (
Evaluation.query.get_or_404(evaluation_id) Evaluation.get_evaluation(evaluation_id) if evaluation_id is not None else None
if evaluation_id is not None
else None
) )
# Vérification des dates # Vérification des dates
try: try:
date_debut = datetime.datetime.fromisoformat(date_debut_str) date_debut = datetime.datetime.fromisoformat(date_debut_str)
@ -1286,7 +1285,9 @@ def etat_abs_date():
evaluation=evaluation, evaluation=evaluation,
etuds=etuds, etuds=etuds,
group_title=", ".join(gr.get_nom_with_part("tous") for gr in groups), group_title=", ".join(gr.get_nom_with_part("tous") for gr in groups),
sco=ScoData(), sco=ScoData(
formsemestre=evaluation.moduleimpl.formsemestre if evaluation else None
),
table=table, table=table,
) )
@ -2159,7 +2160,7 @@ def edit_assiduite_etud(assiduite_id: int):
return render_template( return render_template(
"assiduites/pages/edit_assiduite_etud.j2", "assiduites/pages/edit_assiduite_etud.j2",
etud=etud, etud=etud,
sco=ScoData(etud, formsemestre=formsemestre), sco=ScoData(etud=etud, formsemestre=formsemestre),
form=form, form=form,
readonly=readonly, readonly=readonly,
objet=_preparer_objet("assiduite", assi), objet=_preparer_objet("assiduite", assi),

View File

@ -78,9 +78,9 @@ def formulaire_feuille_appel(formsemestre_id: int):
return render_template( return render_template(
"scolar/formulaire_feuille_appel.j2", "scolar/formulaire_feuille_appel.j2",
sco_data=ScoData(formsemestre=formsemestre),
form=form, form=form,
group_name=groups_infos.groups_titles, group_name=groups_infos.groups_titles,
grp=menu_groups_choice(groups_infos), grp=menu_groups_choice(groups_infos),
formsemestre_id=formsemestre_id, formsemestre_id=formsemestre_id,
sco=ScoData(formsemestre=formsemestre),
) )

View File

@ -868,7 +868,7 @@ def formsemestre_jury_erase(formsemestre_id: int, etudid: int = None):
@permission_required(Permission.EtudInscrit) @permission_required(Permission.EtudInscrit)
def erase_decisions_annee_formation(etudid: int, formation_id: int, annee: int): def erase_decisions_annee_formation(etudid: int, formation_id: int, annee: int):
"""Efface toute les décisions d'une année pour cet étudiant""" """Efface toute les décisions d'une année pour cet étudiant"""
etud: Identite = Identite.query.get_or_404(etudid) etud = Identite.get_etud(etudid)
formation: Formation = Formation.query.filter_by( formation: Formation = Formation.query.filter_by(
id=formation_id, dept_id=g.scodoc_dept_id id=formation_id, dept_id=g.scodoc_dept_id
).first_or_404() ).first_or_404()
@ -899,7 +899,7 @@ def erase_decisions_annee_formation(etudid: int, formation_id: int, annee: int):
formation=formation, formation=formation,
formsemestre_origine=formsemestre_origine, formsemestre_origine=formsemestre_origine,
validations=validations, validations=validations,
sco=ScoData(), sco=ScoData(etud=etud),
title=f"Effacer décisions de jury {etud.nom} - année {annee}", title=f"Effacer décisions de jury {etud.nom} - année {annee}",
) )

View File

@ -339,7 +339,7 @@ def formsemestre_bulletinetud(
menu_autres_operations=sco_bulletins.make_menu_autres_operations( menu_autres_operations=sco_bulletins.make_menu_autres_operations(
formsemestre, etud, "notes.formsemestre_bulletinetud", version formsemestre, etud, "notes.formsemestre_bulletinetud", version
), ),
sco=ScoData(etud=etud), sco=ScoData(etud=etud, formsemestre=formsemestre),
scu=scu, scu=scu,
time=time, time=time,
title=f"Bul. {etud.nom} - BUT", title=f"Bul. {etud.nom} - BUT",