diff --git a/app/scodoc/notesdb.py b/app/scodoc/notesdb.py index b03b5427d9..9be12f3954 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 50984e04eb..b21cb8c0b8 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]