From d2bd88ba320b751cf14213b1c97c770290004929 Mon Sep 17 00:00:00 2001 From: iziram Date: Thu, 7 Sep 2023 08:59:06 +0200 Subject: [PATCH] Assiduites : fix evaluation check abs + partition editor --- app/scodoc/sco_evaluation_check_abs.py | 8 +++----- app/views/scolar.py | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/scodoc/sco_evaluation_check_abs.py b/app/scodoc/sco_evaluation_check_abs.py index a59cc44c81..41299056aa 100644 --- a/app/scodoc/sco_evaluation_check_abs.py +++ b/app/scodoc/sco_evaluation_check_abs.py @@ -51,7 +51,7 @@ def evaluation_check_absences(evaluation: Evaluation): EXC et pas justifie Ramene 5 listes d'etudid """ - if not evaluation.date_debut: + if not evaluation.date_debut or not evaluation.date_fin: return [], [], [], [], [] # evaluation sans date etudids = [ @@ -68,10 +68,8 @@ def evaluation_check_absences(evaluation: Evaluation): assiduites: Query = Assiduite.query.filter( Assiduite.etudid.in_(etudids), Assiduite.etat == scu.EtatAssiduite.ABSENT, - or_( - and_(Assiduite.date_debut >= deb, Assiduite.date_debut <= fin), - and_(Assiduite.date_fin >= deb, Assiduite.date_fin <= fin), - ), + fin >= Assiduite.date_debut, + deb <= Assiduite.date_fin, ) abs_etudids = set(assi.etudid for assi in assiduites) diff --git a/app/views/scolar.py b/app/views/scolar.py index ee36c79e3b..3d8b6f296a 100644 --- a/app/views/scolar.py +++ b/app/views/scolar.py @@ -933,6 +933,7 @@ def partition_editor(formsemestre_id: int, edit_partition=False): formsemestre=formsemestre, read_only=not formsemestre.can_change_groups(), edit_partition=edit_partition, + scu=scu, ), html_sco_header.sco_footer(), ]