From 950c0826b712cd56fa86d1f0c9eeb4b1e1873285 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Mon, 19 Sep 2022 15:14:15 +0200 Subject: [PATCH] Fix: bul BUT malus non inscrit --- app/but/bulletin_but_pdf.py | 16 ++++++++++++---- sco_version.py | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/but/bulletin_but_pdf.py b/app/but/bulletin_but_pdf.py index 481ac4150..526465f57 100644 --- a/app/but/bulletin_but_pdf.py +++ b/app/but/bulletin_but_pdf.py @@ -195,10 +195,18 @@ class BulletinGeneratorStandardBUT(BulletinGeneratorStandard): ects_txt = "" # case Bonus/Malus/Rang "bmr" fields_bmr = [] - if float(ue["bonus"]) != 0: - fields_bmr.append(f"Bonus: {ue['bonus']}") - if float(ue["malus"]) != 0: - fields_bmr.append(f"Malus: {ue['malus']}") + try: + value = float(ue["bonus"]) + if value != 0: + fields_bmr.append(f"Bonus: {ue['bonus']}") + except ValueError: + pass + try: + value = float(ue["malus"]) + if value != 0: + fields_bmr.append(f"Malus: {ue['malus']}") + except ValueError: + pass if self.preferences["bul_show_ue_rangs"]: fields_bmr.append( f"Rang: {ue['moyenne']['rang']} / {ue['moyenne']['total']}" diff --git a/sco_version.py b/sco_version.py index 1ea3e57a9..ed1190cdf 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.3.39" +SCOVERSION = "9.3.40" SCONAME = "ScoDoc"