From 3c970c331ceb7fef0f78d05c6e500c177ab6d037 Mon Sep 17 00:00:00 2001 From: kkthxbye-code Date: Wed, 8 Feb 2023 09:33:06 +0100 Subject: [PATCH] Fixes #11582: Fix missing VC form errors ### Fixes: #11582 Not sure if this is the correct fix or not. The reason that the custom field errors were not shown is that messages.html only shows non_field_errors if the form passed to the context is named form. This is probably an issue in more places, but not sure how to make it generic. A change to messages.html would also need to support formsets. Any input appreciated @jeremystretch or @arthanson --- netbox/templates/dcim/virtualchassis_add_member.html | 2 ++ netbox/templates/dcim/virtualchassis_edit.html | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/netbox/templates/dcim/virtualchassis_add_member.html b/netbox/templates/dcim/virtualchassis_add_member.html index 17ffd64d9..bc2ba2f55 100644 --- a/netbox/templates/dcim/virtualchassis_add_member.html +++ b/netbox/templates/dcim/virtualchassis_add_member.html @@ -5,6 +5,8 @@ {% block content %}
+ {% render_errors membership_form %} + {% csrf_token %}
Add New Member
diff --git a/netbox/templates/dcim/virtualchassis_edit.html b/netbox/templates/dcim/virtualchassis_edit.html index f98a9fe64..433837cf5 100644 --- a/netbox/templates/dcim/virtualchassis_edit.html +++ b/netbox/templates/dcim/virtualchassis_edit.html @@ -8,6 +8,10 @@
+ {% for form in formset %} + {% render_errors form %} + {% endfor %} + {% csrf_token %} {{ pk_form.pk }} {{ formset.management_form }}