diff --git a/app/views/scodoc.py b/app/views/scodoc.py index e60fd63ef..4867ecd6c 100644 --- a/app/views/scodoc.py +++ b/app/views/scodoc.py @@ -264,11 +264,15 @@ def get_bonus_description(bonus_name: str): bonus_name = "" bonus_class = ScoDocSiteConfig.get_bonus_sport_class_from_name(bonus_name) text = bonus_class.__doc__ - fields = re.split(r"\n\n", text, maxsplit=1) - if len(fields) > 1: - first_line, text = fields + if text: + fields = re.split(r"\n\n", text, maxsplit=1) + if len(fields) > 1: + first_line, text = fields + else: + first_line, text = "", fields[0] else: - first_line, text = "", fields[0] + text = "" + first_line = "pas de fonction bonus configurée." return f"""
{first_line}
{text}