Affichage fct bonus si pas configurée

This commit is contained in:
Emmanuel Viennet 2022-02-11 09:58:27 +01:00
parent bc4cd63ea8
commit 5a270945e9

View File

@ -264,11 +264,15 @@ def get_bonus_description(bonus_name: str):
bonus_name = "" bonus_name = ""
bonus_class = ScoDocSiteConfig.get_bonus_sport_class_from_name(bonus_name) bonus_class = ScoDocSiteConfig.get_bonus_sport_class_from_name(bonus_name)
text = bonus_class.__doc__ text = bonus_class.__doc__
fields = re.split(r"\n\n", text, maxsplit=1) if text:
if len(fields) > 1: fields = re.split(r"\n\n", text, maxsplit=1)
first_line, text = fields if len(fields) > 1:
first_line, text = fields
else:
first_line, text = "", fields[0]
else: else:
first_line, text = "", fields[0] text = ""
first_line = "pas de fonction bonus configurée."
return f"""<div class="bonus_description_head">{first_line}</div> return f"""<div class="bonus_description_head">{first_line}</div>
<div>{text}</div> <div>{text}</div>