Update opolka/ScoDoc from ScoDoc/ScoDoc #2

Merged
opolka merged 1272 commits from ScoDoc/ScoDoc:master into master 2024-05-27 09:11:04 +02:00
2 changed files with 10 additions and 2 deletions
Showing only changes of commit 14286b31ac - Show all commits

View File

@ -457,7 +457,7 @@ def justif_edit(justif_id: int):
"après": compute_assiduites_justified(
justificatif_unique.etudid,
[justificatif_unique],
False,
True,
),
}
}

View File

@ -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)