Améliore page affichage ScoValueError

This commit is contained in:
Emmanuel Viennet 2024-08-23 19:01:10 +02:00
parent f2f616d643
commit c1e6b67f20
2 changed files with 14 additions and 6 deletions

View File

@ -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):

View File

@ -11,15 +11,21 @@
{{ exc }}
{% endif %}
{% if exc.dest_url is not string or exc.dest_url|length > 0 %}
<div style="margin-top: 16px;">
{% if g.scodoc_dept %}
<a class="stdlink" href="{{ exc.dest_url or url_for('scolar.index_html', scodoc_dept=g.scodoc_dept) }}">continuer</a>
{% elif exc.dest_url %}
<a class="stdlink" href="{{ exc.dest_url or url_for('scodoc.index') }}">continuer</a>
{% if exc.dest_url %}
<a class="stdlink" href="{{ exc.dest_url or url_for('scodoc.index') }}">
{{exc.dest_label or 'continuer'}}
</a>
{% elif g.scodoc_dept %}
<a class="stdlink" href="{{
url_for('scolar.index_html', scodoc_dept=g.scodoc_dept)
}}">retour page département</a>
{% else %}
<a class="stdlink" href="{{ exc.dest_url or url_for('scodoc.index') }}">retour page d'accueil</a>
{% endif %}
</div>
{% endif %}
<p style="margin-top: 32px;" class="help">
Si le problème persiste, merci de contacter le support ScoDoc via