Fix: bul BUT malus non inscrit

This commit is contained in:
Emmanuel Viennet 2022-09-19 15:14:15 +02:00
parent 22f906e726
commit 950c0826b7
2 changed files with 13 additions and 5 deletions

View File

@ -195,10 +195,18 @@ class BulletinGeneratorStandardBUT(BulletinGeneratorStandard):
ects_txt = "" ects_txt = ""
# case Bonus/Malus/Rang "bmr" # case Bonus/Malus/Rang "bmr"
fields_bmr = [] fields_bmr = []
if float(ue["bonus"]) != 0: try:
fields_bmr.append(f"Bonus: {ue['bonus']}") value = float(ue["bonus"])
if float(ue["malus"]) != 0: if value != 0:
fields_bmr.append(f"Malus: {ue['malus']}") 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"]: if self.preferences["bul_show_ue_rangs"]:
fields_bmr.append( fields_bmr.append(
f"Rang: {ue['moyenne']['rang']} / {ue['moyenne']['total']}" f"Rang: {ue['moyenne']['rang']} / {ue['moyenne']['total']}"

View File

@ -1,7 +1,7 @@
# -*- mode: python -*- # -*- mode: python -*-
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
SCOVERSION = "9.3.39" SCOVERSION = "9.3.40"
SCONAME = "ScoDoc" SCONAME = "ScoDoc"