From f683e6a041b03f10feab768502a2caaf74103554 Mon Sep 17 00:00:00 2001 From: iziram Date: Mon, 31 Jul 2023 16:15:59 +0200 Subject: [PATCH] Assiduites : bugfix justificatif create --- app/api/justificatifs.py | 5 ++--- app/templates/assiduites/widgets/tableau_justi.j2 | 8 +++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/api/justificatifs.py b/app/api/justificatifs.py index f12859fa..bbc98b48 100644 --- a/app/api/justificatifs.py +++ b/app/api/justificatifs.py @@ -208,7 +208,8 @@ def justif_create(etudid: int = None, nip=None, ine=None): success.append({"indice": i, "message": obj}) justifs.append(justi) scass.simple_invalidate_cache(data, etud.id) - compute_assiduites_justified(etudid, justifs, True) + + compute_assiduites_justified(etud.etudid, justifs, True) return {"errors": errors, "success": success} @@ -252,8 +253,6 @@ def _create_singular( if external_data is not None: if not isinstance(external_data, dict): errors.append("param 'external_data' : n'est pas un objet JSON") - else: - assiduite_unique.external_data = external_data if errors: err: str = ", ".join(errors) diff --git a/app/templates/assiduites/widgets/tableau_justi.j2 b/app/templates/assiduites/widgets/tableau_justi.j2 index e9fef337..1cbeea8a 100644 --- a/app/templates/assiduites/widgets/tableau_justi.j2 +++ b/app/templates/assiduites/widgets/tableau_justi.j2 @@ -310,9 +310,11 @@ assiEdit.querySelector('#justi_etat').value = data.etat.toLowerCase(); assiEdit.querySelector('#justi_raison').value = desc; - - assiEdit.querySelector('#justi_date_debut').value = moment.tz(data.date_debut, TIMEZONE).format("YYYY-MM-DDTHH:MM") - assiEdit.querySelector('#justi_date_fin').value = moment.tz(data.date_fin, TIMEZONE).format("YYYY-MM-DDTHH:MM") + const d_deb = moment.tz(data.date_debut, TIMEZONE).format("YYYY-MM-DDTHH:mm") + const d_fin = moment.tz(data.date_fin, TIMEZONE).format("YYYY-MM-DDTHH:mm") + console.warn(d_deb, d_fin, data.date_debut, data.date_fin) + assiEdit.querySelector('#justi_date_debut').value = d_deb + assiEdit.querySelector('#justi_date_fin').value = d_fin const fichContent = assiEdit.querySelector('.justi-sect');