From 104a7058a10e26b18c127973047630955ced62da Mon Sep 17 00:00:00 2001 From: iziram Date: Mon, 20 Feb 2023 14:20:54 +0100 Subject: [PATCH] bug fix: filtrage par date --- app/api/assiduites.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/api/assiduites.py b/app/api/assiduites.py index 99471b25..ae0fc5b4 100644 --- a/app/api/assiduites.py +++ b/app/api/assiduites.py @@ -486,13 +486,13 @@ def _count_manager(requested) -> tuple[str, dict]: filtered["etat"] = etat # 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) if deb is not None: filtered["date_debut"] = deb # 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 fin is not None: @@ -538,12 +538,12 @@ def _filter_manager(requested, assiduites_query: Assiduite): assiduites_query = scass.filter_assiduites_by_etat(assiduites_query, etat) # 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 = scu.is_iso_formated(fin, True) + fin = requested.args.get("date_fin", "") + fin = scu.is_iso_formated(fin, True).replace(" ", "+") if (deb, fin) != (None, None): assiduites_query: Assiduite = scass.filter_by_date(