erratum + oubli bug fix date api

This commit is contained in:
iziram 2023-02-20 18:12:49 +01:00
parent 104a7058a1
commit 6468bb30e4
2 changed files with 6 additions and 6 deletions

View File

@ -542,8 +542,8 @@ def _filter_manager(requested, assiduites_query: Assiduite):
deb: datetime = scu.is_iso_formated(deb, True) deb: datetime = scu.is_iso_formated(deb, True)
# cas 3 : date de fin # 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).replace(" ", "+") fin = scu.is_iso_formated(fin, True)
if (deb, fin) != (None, None): if (deb, fin) != (None, None):
assiduites_query: Assiduite = scass.filter_by_date( assiduites_query: Assiduite = scass.filter_by_date(

View File

@ -261,7 +261,7 @@ def justif_edit(justif_id: int):
if date_debut is not False: if date_debut is not False:
if date_debut is None: if date_debut is None:
errors.append("param 'date_debut': manquant") 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: if deb is None:
errors.append("param 'date_debut': format invalide") 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 not False:
if date_fin is None: if date_fin is None:
errors.append("param 'date_fin': manquant") 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: if fin is None:
errors.append("param 'date_fin': format invalide") errors.append("param 'date_fin': format invalide")
if justificatif_unique.date_debut <= fin: if justificatif_unique.date_debut <= fin:
@ -565,11 +565,11 @@ def _filter_manager(requested, justificatifs_query):
) )
# cas 2 : date de début # 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) deb: datetime = scu.is_iso_formated(deb, True)
# cas 3 : date de fin # 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) fin = scu.is_iso_formated(fin, True)
if (deb, fin) != (None, None): if (deb, fin) != (None, None):