diff --git a/app/api/jury.py b/app/api/jury.py index 450edde7..d3a1d145 100644 --- a/app/api/jury.py +++ b/app/api/jury.py @@ -269,13 +269,7 @@ def validation_rcue_record(etudid: int): validation.parcours_id = parcours_id validation.ue1_id = ue1_id validation.ue2_id = ue2_id - log(f"updating {validation}") - Scolog.logdb( - method="validation_rcue_record", - etudid=etudid, - msg=f"Mise à jour {validation}", - commit=False, - ) + operation = "update" else: validation = ApcValidationRCUE( code=code, @@ -286,15 +280,16 @@ def validation_rcue_record(etudid: int): ue1_id=ue1_id, ue2_id=ue2_id, ) - log(f"recording {validation}") - Scolog.logdb( - method="validation_rcue_record", - etudid=etudid, - msg=f"Enregistrement {validation}", - commit=False, - ) + operation = "record" db.session.add(validation) db.session.commit() + Scolog.logdb( + method="validation_rcue_record", + etudid=etudid, + msg=f"Enregistrement {validation}", + commit=True, + ) + log(f"{operation} {validation}") return validation.to_dict() diff --git a/app/models/but_validations.py b/app/models/but_validations.py index 185ab539..6a3939a6 100644 --- a/app/models/but_validations.py +++ b/app/models/but_validations.py @@ -82,6 +82,10 @@ class ApcValidationRCUE(db.Model): "as a dict" d = dict(self.__dict__) d.pop("_sa_instance_state", None) + d["etud"] = self.etud.to_dict_short() + d["ue1"] = self.ue1.to_dict() + d["ue2"] = self.ue2.to_dict() + return d def to_dict_bul(self) -> dict: diff --git a/app/scodoc/sco_page_etud.py b/app/scodoc/sco_page_etud.py index 7058b341..403b8947 100644 --- a/app/scodoc/sco_page_etud.py +++ b/app/scodoc/sco_page_etud.py @@ -517,7 +517,7 @@ def ficheEtud(etudid=None): cursus=but_cursus, scu=scu, )} -
+