From 9e85698f0421b03034b8f593b9dbde0314e46d1e Mon Sep 17 00:00:00 2001 From: Julien Dudek <46819368+J-Dudek@users.noreply.github.com> Date: Fri, 18 Oct 2024 00:12:52 +0200 Subject: [PATCH] =?UTF-8?q?test=20de=20nullit=C3=A9=20sur=20moyennes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ecole_directe/ecole_directe_helper.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/custom_components/ecole_directe/ecole_directe_helper.py b/custom_components/ecole_directe/ecole_directe_helper.py index e887927..f827e36 100644 --- a/custom_components/ecole_directe/ecole_directe_helper.py +++ b/custom_components/ecole_directe/ecole_directe_helper.py @@ -576,12 +576,12 @@ def get_disciplines_periode(data): if "disciplines" in data["ensembleMatieres"]: for discipline_json in data["ensembleMatieres"]["disciplines"]: discipline = { - "name": discipline_json["discipline"].lower(), - "moyenne": discipline_json["moyenne"], - "moyenneClasse": discipline_json["moyenneClasse"], - "moyenneMin": discipline_json["moyenneMin"], - "moyenneMax": discipline_json["moyenneMax"], - "appreciations":discipline_json["appreciations"], + "name": discipline_json.get("discipline", "").lower(), + "moyenne": discipline_json.get("moyenne", ""), + "moyenneClasse": discipline_json.get("moyenneClasse", ""), + "moyenneMin": discipline_json.get("moyenneMin", ""), + "moyenneMax": discipline_json.get("moyenneMax", ""), + "appreciations": discipline_json.get("appreciations", ""), } disciplines.append(discipline) return disciplines