From 81720facffe7baddc9f20c5976bb241834ee53a8 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Wed, 3 Nov 2021 14:12:27 +0100 Subject: [PATCH] Fix: ListeAbsEtud arg --- app/scodoc/notesdb.py | 6 +++--- app/scodoc/sco_abs_views.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/scodoc/notesdb.py b/app/scodoc/notesdb.py index b03b5427d..9be12f395 100644 --- a/app/scodoc/notesdb.py +++ b/app/scodoc/notesdb.py @@ -602,15 +602,15 @@ BOOL_STR = { "false": False, "0": False, "1": True, - "true": "true", + "true": True, } -def bool_or_str(x): +def bool_or_str(x) -> bool: """a boolean, may also be encoded as a string "0", "False", "1", "True" """ if isinstance(x, str): return BOOL_STR[x.lower()] - return x + return bool(x) # post filtering diff --git a/app/scodoc/sco_abs_views.py b/app/scodoc/sco_abs_views.py index 50984e04e..b21cb8c0b 100644 --- a/app/scodoc/sco_abs_views.py +++ b/app/scodoc/sco_abs_views.py @@ -790,7 +790,8 @@ def ListeAbsEtud( absjust_only: si vrai, renvoie table absences justifiées sco_year: année scolaire à utiliser. Si non spécifier, utilie l'année en cours. e.g. "2005" """ - absjust_only = int(absjust_only) # si vrai, table absjust seule (export xls ou pdf) + # si absjust_only, table absjust seule (export xls ou pdf) + absjust_only = ndb.bool_or_str(absjust_only) datedebut = "%s-08-01" % scu.AnneeScolaire(sco_year=sco_year) etud = sco_etud.get_etud_info(etudid=etudid, filled=True)[0]