1
0
forked from ScoDoc/ScoDoc

Fix: ListeAbsEtud arg

This commit is contained in:
Emmanuel Viennet 2021-11-03 14:12:27 +01:00
parent 1c719b5c7c
commit 81720facff
2 changed files with 5 additions and 4 deletions

View File

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

View File

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