Show error elegantly
This commit is contained in:
parent
7eff6fc92c
commit
b284ed70a6
2 changed files with 3 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
{% if messages %}
|
{% if messages %}
|
||||||
<ul class="list-unstyled msg-list">
|
<ul class="list-unstyled msg-list">
|
||||||
{% for message in messages %}
|
{% for message in messages %}
|
||||||
<div class="alert {% if message.tags and message.tags == 'error' %} alert-danger {% else %} alert-{{message.tags}} {% endif %}">{{ message|safe }}</div>
|
<div class="alert {% if message.tags and (message.tags == 'error' or message.tags == 'vat_error') %} alert-danger {% else %} alert-{{message.tags}} {% endif %}">{{ message|safe }}</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
|
@ -642,7 +642,8 @@ class SettingsView(LoginRequiredMixin, FormView):
|
||||||
)
|
)
|
||||||
if 'error' in validate_result and validate_result['error']:
|
if 'error' in validate_result and validate_result['error']:
|
||||||
messages.add_message(
|
messages.add_message(
|
||||||
request, messages.ERROR, validate_result["error"],
|
request, messages.ERROR,
|
||||||
|
"VAT Number validation error: %s" % validate_result["error"],
|
||||||
extra_tags='vat_error'
|
extra_tags='vat_error'
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue