diff --git a/app/scodoc/sco_exceptions.py b/app/scodoc/sco_exceptions.py index 741ad9fd..a7057883 100644 --- a/app/scodoc/sco_exceptions.py +++ b/app/scodoc/sco_exceptions.py @@ -52,10 +52,12 @@ class ScoValueError(ScoException): # mal nommée: super classe de toutes les exceptions avec page # d'erreur gentille. - def __init__(self, msg, dest_url=None, safe=False): + def __init__(self, msg, dest_url=None, dest_label=None, safe=False): super().__init__(msg) + # champs utilisés par template sco_value_error.j2 self.dest_url = dest_url - self.safe = safe # utilisé par template sco_value_error.j2 + self.dest_label = dest_label + self.safe = safe class ScoPermissionDenied(ScoValueError): diff --git a/app/templates/sco_value_error.j2 b/app/templates/sco_value_error.j2 index 2a488c93..15b3fdee 100644 --- a/app/templates/sco_value_error.j2 +++ b/app/templates/sco_value_error.j2 @@ -11,15 +11,21 @@ {{ exc }} {% endif %} +{% if exc.dest_url is not string or exc.dest_url|length > 0 %}
- {% if g.scodoc_dept %} - continuer - {% elif exc.dest_url %} - continuer + {% if exc.dest_url %} + + {{exc.dest_label or 'continuer'}} + + {% elif g.scodoc_dept %} + retour page département {% else %} retour page d'accueil {% endif %}
+{% endif %}

Si le problème persiste, merci de contacter le support ScoDoc via