Assiduites : fix evaluation check abs + partition editor

This commit is contained in:
iziram 2023-09-07 08:59:06 +02:00
parent 9105a9a5f0
commit d2bd88ba32
2 changed files with 4 additions and 5 deletions

View File

@ -51,7 +51,7 @@ def evaluation_check_absences(evaluation: Evaluation):
EXC et pas justifie EXC et pas justifie
Ramene 5 listes d'etudid Ramene 5 listes d'etudid
""" """
if not evaluation.date_debut: if not evaluation.date_debut or not evaluation.date_fin:
return [], [], [], [], [] # evaluation sans date return [], [], [], [], [] # evaluation sans date
etudids = [ etudids = [
@ -68,10 +68,8 @@ def evaluation_check_absences(evaluation: Evaluation):
assiduites: Query = Assiduite.query.filter( assiduites: Query = Assiduite.query.filter(
Assiduite.etudid.in_(etudids), Assiduite.etudid.in_(etudids),
Assiduite.etat == scu.EtatAssiduite.ABSENT, Assiduite.etat == scu.EtatAssiduite.ABSENT,
or_( fin >= Assiduite.date_debut,
and_(Assiduite.date_debut >= deb, Assiduite.date_debut <= fin), deb <= Assiduite.date_fin,
and_(Assiduite.date_fin >= deb, Assiduite.date_fin <= fin),
),
) )
abs_etudids = set(assi.etudid for assi in assiduites) abs_etudids = set(assi.etudid for assi in assiduites)

View File

@ -933,6 +933,7 @@ def partition_editor(formsemestre_id: int, edit_partition=False):
formsemestre=formsemestre, formsemestre=formsemestre,
read_only=not formsemestre.can_change_groups(), read_only=not formsemestre.can_change_groups(),
edit_partition=edit_partition, edit_partition=edit_partition,
scu=scu,
), ),
html_sco_header.sco_footer(), html_sco_header.sco_footer(),
] ]