bug fix: filtrage par date

This commit is contained in:
iziram 2023-02-20 14:20:54 +01:00
parent 345a842f59
commit 104a7058a1

View File

@ -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(