From 6468bb30e451bfa0c5b09424acfeb8b8f522eaf4 Mon Sep 17 00:00:00 2001 From: iziram Date: Mon, 20 Feb 2023 18:12:49 +0100 Subject: [PATCH] erratum + oubli bug fix date api --- app/api/assiduites.py | 4 ++-- app/api/justificatifs.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/api/assiduites.py b/app/api/assiduites.py index ae0fc5b4..18ff08e0 100644 --- a/app/api/assiduites.py +++ b/app/api/assiduites.py @@ -542,8 +542,8 @@ def _filter_manager(requested, assiduites_query: Assiduite): deb: datetime = scu.is_iso_formated(deb, True) # cas 3 : date de fin - fin = requested.args.get("date_fin", "") - fin = scu.is_iso_formated(fin, True).replace(" ", "+") + fin = requested.args.get("date_fin", "").replace(" ", "+") + fin = scu.is_iso_formated(fin, True) if (deb, fin) != (None, None): assiduites_query: Assiduite = scass.filter_by_date( diff --git a/app/api/justificatifs.py b/app/api/justificatifs.py index 457e1bf7..db8db63d 100644 --- a/app/api/justificatifs.py +++ b/app/api/justificatifs.py @@ -261,7 +261,7 @@ def justif_edit(justif_id: int): if date_debut is not False: if date_debut is None: errors.append("param 'date_debut': manquant") - deb = scu.is_iso_formated(date_debut, convert=True) + deb = scu.is_iso_formated(date_debut.replace(" ", "+"), convert=True) if deb is None: errors.append("param 'date_debut': format invalide") @@ -273,7 +273,7 @@ def justif_edit(justif_id: int): if date_fin is not False: if date_fin is None: errors.append("param 'date_fin': manquant") - fin = scu.is_iso_formated(date_fin, convert=True) + fin = scu.is_iso_formated(date_fin.replace(" ", "+"), convert=True) if fin is None: errors.append("param 'date_fin': format invalide") if justificatif_unique.date_debut <= fin: @@ -565,11 +565,11 @@ def _filter_manager(requested, justificatifs_query): ) # cas 2 : date de début - deb = requested.args.get("date_debut") + deb = requested.args.get("date_debut", "").replace(" ", "+") deb: datetime = scu.is_iso_formated(deb, True) # cas 3 : date de fin - fin = requested.args.get("date_fin") + fin = requested.args.get("date_fin", "").replace(" ", "+") fin = scu.is_iso_formated(fin, True) if (deb, fin) != (None, None):