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"""

Répartition des groupes de {partition.partition_name}

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/") +@scodoc +@permission_required(Permission.ScoView) +def evaluation_check_absences_html(evaluation_id: int): + "Check absences sur une évaluation" + evaluation: Evaluation = Evaluation.query.get_or_404(evaluation_id) + return sco_evaluation_check_abs.evaluation_check_absences_html(evaluation) + + sco_publish( "/formsemestre_check_absences_html", sco_evaluation_check_abs.formsemestre_check_absences_html, diff --git a/app/views/scolar.py b/app/views/scolar.py index b8a4466e7..ee36c79e3 100644 --- a/app/views/scolar.py +++ b/app/views/scolar.py @@ -50,14 +50,16 @@ from app.decorators import ( scodoc7func, permission_required, permission_required_compat_scodoc7, - admin_required, - login_required, ) -from app.models.etudiants import Identite +from app.models import ( + FormSemestre, + Identite, + Partition, + ScolarEvent, + ScolarNews, + Scolog, +) from app.models.etudiants import make_etud_args -from app.models.events import ScolarNews, Scolog -from app.models.formsemestre import FormSemestre -from app.models.validations import ScolarEvent from app.views import scolar_bp as bp from app.views import ScoData @@ -67,7 +69,6 @@ from app.scodoc.scolog import logdb from app.scodoc.sco_permissions import Permission from app.scodoc.sco_exceptions import ( AccessDenied, - ScoException, ScoValueError, ) @@ -845,12 +846,15 @@ sco_publish( methods=["GET", "POST"], ) -sco_publish( - "/groups_auto_repartition", - sco_groups.groups_auto_repartition, - Permission.ScoView, - methods=["GET", "POST"], -) + +@bp.route("/groups_auto_repartition/", methods=["GET", "POST"]) +@scodoc +@permission_required(Permission.ScoView) +def groups_auto_repartition(partition_id: int): + "Réparti les etudiants dans des groupes dans une partition" + partition: Partition = Partition.query.get_or_404(partition_id) + return sco_groups.groups_auto_repartition(partition) + sco_publish( "/edit_partition_form", diff --git a/sco_version.py b/sco_version.py index 43b8cef6b..a9d45b757 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.6.20" +SCOVERSION = "9.6.21" SCONAME = "ScoDoc"