aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--budget/templates/display_errors.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/budget/templates/display_errors.html b/budget/templates/display_errors.html
index 15039a2..bc65a3a 100644
--- a/budget/templates/display_errors.html
+++ b/budget/templates/display_errors.html
@@ -1,5 +1,5 @@
-{% for errors in form.errors.values() %}
- {% for error in errors %}
- <p class="error">{{error}}</p>
+{% for field_name, field_errors in form.errors.items() if field_errors %}
+ {% for error in field_errors %}
+ <p class="error">{{ form[field_name].label.text }}: {{ error }}</p>
{% endfor %}
{% endfor %}