{% if saved_pk %} {# Saved successfully — notify parent and close #}

Supplier saved. This window will close automatically.

{% else %}

Add supplier

{% csrf_token %} {% for field in form %}
{{ field }} {% if field.errors %} {{ field.errors|join:", " }} {% endif %}
{% endfor %} {% if form.non_field_errors %}
{{ form.non_field_errors }}
{% endif %}
{% endif %}