Skip to content
Snippets Groups Projects
Commit c1e6b67f authored by Emmanuel Viennet's avatar Emmanuel Viennet
Browse files

Améliore page affichage ScoValueError

parent f2f616d6
Branches
No related tags found
No related merge requests found
...@@ -52,10 +52,12 @@ class ScoValueError(ScoException): ...@@ -52,10 +52,12 @@ class ScoValueError(ScoException):
# mal nommée: super classe de toutes les exceptions avec page # mal nommée: super classe de toutes les exceptions avec page
# d'erreur gentille. # 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) super().__init__(msg)
# champs utilisés par template sco_value_error.j2
self.dest_url = dest_url 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): class ScoPermissionDenied(ScoValueError):
......
...@@ -11,15 +11,21 @@ ...@@ -11,15 +11,21 @@
{{ exc }} {{ exc }}
{% endif %} {% endif %}
{% if exc.dest_url is not string or exc.dest_url|length > 0 %}
<div style="margin-top: 16px;"> <div style="margin-top: 16px;">
{% if g.scodoc_dept %} {% if exc.dest_url %}
<a class="stdlink" href="{{ exc.dest_url or url_for('scolar.index_html', scodoc_dept=g.scodoc_dept) }}">continuer</a> <a class="stdlink" href="{{ exc.dest_url or url_for('scodoc.index') }}">
{% elif exc.dest_url %} {{exc.dest_label or 'continuer'}}
<a class="stdlink" href="{{ exc.dest_url or url_for('scodoc.index') }}">continuer</a> </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 %} {% else %}
<a class="stdlink" href="{{ exc.dest_url or url_for('scodoc.index') }}">retour page d'accueil</a> <a class="stdlink" href="{{ exc.dest_url or url_for('scodoc.index') }}">retour page d'accueil</a>
{% endif %} {% endif %}
</div> </div>
{% endif %}
<p style="margin-top: 32px;" class="help"> <p style="margin-top: 32px;" class="help">
Si le problème persiste, merci de contacter le support ScoDoc via Si le problème persiste, merci de contacter le support ScoDoc via
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment