Assiduites : fix justificatifs #748
This commit is contained in:
parent
71b41d3dc6
commit
14286b31ac
@ -457,7 +457,7 @@ def justif_edit(justif_id: int):
|
||||
"après": compute_assiduites_justified(
|
||||
justificatif_unique.etudid,
|
||||
[justificatif_unique],
|
||||
False,
|
||||
True,
|
||||
),
|
||||
}
|
||||
}
|
||||
|
@ -362,9 +362,17 @@ def compute_assiduites_justified(
|
||||
for assi in assiduites:
|
||||
if assi.etat == EtatAssiduite.PRESENT:
|
||||
continue
|
||||
|
||||
assi_justificatifs = Justificatif.query.filter(
|
||||
Justificatif.etudid == assi.etudid,
|
||||
Justificatif.date_debut <= assi.date_debut,
|
||||
Justificatif.date_fin >= assi.date_fin,
|
||||
Justificatif.etat == EtatJustificatif.VALIDE,
|
||||
).all()
|
||||
|
||||
if any(
|
||||
assi.date_debut >= j.date_debut and assi.date_fin <= j.date_fin
|
||||
for j in justificatifs
|
||||
for j in justificatifs + assi_justificatifs
|
||||
):
|
||||
assi.est_just = True
|
||||
assiduites_justifiees.append(assi.assiduite_id)
|
||||
|
Loading…
Reference in New Issue
Block a user