Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Display form non_field_errors in modals

Anna Siwik4e87577b7798
diff --git a/saleor/static/dashboard/scss/components/_modals.scss b/saleor/static/dashboard/scss/components/_modals.scss
index 398052a793..598cb04608 100644
--- a/saleor/static/dashboard/scss/components/_modals.scss
+++ b/saleor/static/dashboard/scss/components/_modals.scss
@@ -11,6 +11,10 @@
.address {
margin: 1rem 0;
}
+
+ blockquote {
+ margin: 0;
+ }
}
#base-modal {
diff --git a/templates/dashboard/base_modal.html b/templates/dashboard/base_modal.html
index 14e2c1b995..d7baaf28e6 100644
--- a/templates/dashboard/base_modal.html
+++ b/templates/dashboard/base_modal.html
@@ -13,6 +13,17 @@
</h5>
</div>
</div>
+ {% if form.non_field_errors %}
+ <div class="row">
+ <div class="col s12">
+ <blockquote>
+ {% for non_field_error in form.non_field_errors %}
+ {{ non_field_error }}
+ {% endfor %}
+ </blockquote>
+ </div>
+ </div>
+ {% endif %}
<div class="row">
{% block content %}{% endblock %}
</div>