From 9deae8cd6a16b58b2810ae1b439bde992312b4a6 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 9 Jul 2024 09:09:25 +0200 Subject: [PATCH] Fix some logs --- app/models/assiduites.py | 2 +- app/models/groups.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/models/assiduites.py b/app/models/assiduites.py index 7c5c1ce26..29b8b8891 100644 --- a/app/models/assiduites.py +++ b/app/models/assiduites.py @@ -558,13 +558,13 @@ class Justificatif(ScoDocModel): Raises ScoValueError si paramètres incorrects. """ nouv_justificatif = cls.create_from_dict(locals()) - db.session.commit() log(f"create_justificatif: etudid={etudiant.id} {nouv_justificatif}") Scolog.logdb( method="create_justificatif", etudid=etudiant.id, msg=f"justificatif: {nouv_justificatif}", ) + db.session.commit() return nouv_justificatif def supprime(self): diff --git a/app/models/groups.py b/app/models/groups.py index 68c7156b8..c654efa70 100644 --- a/app/models/groups.py +++ b/app/models/groups.py @@ -336,13 +336,12 @@ class GroupDescr(ScoDocModel): "Enlève l'étudiant de ce groupe s'il en fait partie (ne fait rien sinon)" if etud in self.etuds: self.etuds.remove(etud) - db.session.commit() Scolog.logdb( method="group_remove_etud", etudid=etud.id, msg=f"Retrait du groupe {self.group_name} de {self.partition.partition_name}", - commit=True, ) + db.session.commit() # Update parcours if self.partition.partition_name == scu.PARTITION_PARCOURS: self.partition.formsemestre.update_inscriptions_parcours_from_groups(