diff --git a/app/scodoc/sco_evaluation_check_abs.py b/app/scodoc/sco_evaluation_check_abs.py index d2dea8096..957ba963c 100644 --- a/app/scodoc/sco_evaluation_check_abs.py +++ b/app/scodoc/sco_evaluation_check_abs.py @@ -108,9 +108,10 @@ def evaluation_check_absences(evaluation: Evaluation): return ValButAbs, AbsNonSignalee, ExcNonSignalee, ExcNonJust, AbsButExc -def evaluation_check_absences_html(evaluation_id, with_header=True, show_ok=True): +def evaluation_check_absences_html( + evaluation: Evaluation, with_header=True, show_ok=True +): """Affiche état vérification absences d'une évaluation""" - evaluation: Evaluation = db.session.get(Evaluation, evaluation_id) am, pm = evaluation.is_matin(), evaluation.is_apresmidi() # 1 si matin, 0 si apres midi, 2 si toute la journee: match am, pm: @@ -249,7 +250,7 @@ def formsemestre_check_absences_html(formsemestre_id): ): H.append( evaluation_check_absences_html( - evaluation.id, # XXX TODO-ASSIDUITE remplacer par evaluation ... + evaluation, with_header=False, show_ok=False, ) diff --git a/app/scodoc/sco_groups.py b/app/scodoc/sco_groups.py index 6a7b686d8..d2df8a21c 100644 --- a/app/scodoc/sco_groups.py +++ b/app/scodoc/sco_groups.py @@ -1377,20 +1377,18 @@ def group_rename(group_id): return group_set_name(group, tf[2]["group_name"]) -def groups_auto_repartition(partition_id=None): - """Reparti les etudiants dans des groupes dans une partition, en respectant le niveau +def groups_auto_repartition(partition: Partition): + """Réparti les etudiants dans des groupes dans une partition, en respectant le niveau et la mixité. """ - partition: Partition = Partition.query.get_or_404(partition_id) if not partition.groups_editable: raise AccessDenied("Partition non éditable") - formsemestre_id = partition.formsemestre_id formsemestre = partition.formsemestre # renvoie sur page édition partitions et groupes dest_url = url_for( "scolar.partition_editor", scodoc_dept=g.scodoc_dept, - formsemestre_id=formsemestre_id, + formsemestre_id=formsemestre.id, ) if not formsemestre.can_change_groups(): raise AccessDenied("Vous n'avez pas le droit d'effectuer cette opération !") @@ -1409,7 +1407,9 @@ def groups_auto_repartition(partition_id=None): ] H = [ - html_sco_header.sco_header(page_title="Répartition des groupes"), + html_sco_header.sco_header( + page_title="Répartition des groupes", formsemestre_id=formsemestre.id + ), f"""
Semestre {formsemestre.titre_annee()}
Les groupes existants seront effacés et remplacés par
@@ -1455,7 +1455,7 @@ def groups_auto_repartition(partition_id=None):
listes = {}
for civilite in civilites:
listes[civilite] = [
- (_get_prev_moy(x["etudid"], formsemestre_id), x["etudid"])
+ (_get_prev_moy(x["etudid"], formsemestre.id), x["etudid"])
for x in identdict.values()
if x["civilite"] == civilite
]
diff --git a/app/templates/scolar/partition_editor.j2 b/app/templates/scolar/partition_editor.j2
index 97744f431..0abd990fd 100644
--- a/app/templates/scolar/partition_editor.j2
+++ b/app/templates/scolar/partition_editor.j2
@@ -224,7 +224,8 @@
Afficher sur bulletins et tableaux
`;
diff --git a/app/views/notes.py b/app/views/notes.py
index f3ad9e440..a7fd0d212 100644
--- a/app/views/notes.py
+++ b/app/views/notes.py
@@ -44,7 +44,6 @@ from app import models
from app.auth.models import User
from app.but import (
apc_edit_ue,
- bulletin_but_court,
cursus_but,
jury_edit_manual,
jury_but,
@@ -58,21 +57,23 @@ from app.but.forms import jury_but_forms
from app.comp import jury, res_sem
from app.comp.res_compat import NotesTableCompat
from app.models import (
+ ApcNiveau,
BulAppreciations,
+ DispenseUE,
Evaluation,
Formation,
+ FormSemestre,
+ FormSemestreInscription,
+ FormSemestreUEComputationExpr,
+ Identite,
+ Module,
+ ModuleImpl,
ScolarAutorisationInscription,
ScolarNews,
Scolog,
+ ScoDocSiteConfig,
+ UniteEns,
)
-from app.models.but_refcomp import ApcNiveau
-from app.models.config import ScoDocSiteConfig
-from app.models.etudiants import Identite
-from app.models.formsemestre import FormSemestre, FormSemestreInscription
-from app.models.formsemestre import FormSemestreUEComputationExpr
-from app.models.moduleimpls import ModuleImpl
-from app.models.modules import Module
-from app.models.ues import DispenseUE, UniteEns
from app.scodoc.sco_exceptions import ScoFormationConflict, ScoPermissionDenied
from app.views import notes_bp as bp
@@ -1790,11 +1791,17 @@ sco_publish(
sco_undo_notes.evaluation_list_operations,
Permission.ScoView,
)
-sco_publish(
- "/evaluation_check_absences_html",
- sco_evaluation_check_abs.evaluation_check_absences_html,
- Permission.ScoView,
-)
+
+
+@bp.route("/evaluation_check_absences_html/