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
This commit is contained in:
kkthxbye-code 2023-02-08 09:33:06 +01:00 committed by Jeremy Stretch
parent 91705aa9fd
commit 3c970c331c
2 changed files with 6 additions and 0 deletions

View File

@ -5,6 +5,8 @@
{% block content %}
<form action="" method="post" enctype="multipart/form-data" class="form-object-edit">
{% render_errors membership_form %}
{% csrf_token %}
<div class="card">
<h5 class="card-header">Add New Member</h5>

View File

@ -8,6 +8,10 @@
<div class="tab-content">
<div class="tab-pane show active" id="edit-form" role="tabpanel" aria-labelledby="object-list-tab">
<form action="" method="post" enctype="multipart/form-data" class="form-object-edit">
{% for form in formset %}
{% render_errors form %}
{% endfor %}
{% csrf_token %}
{{ pk_form.pk }}
{{ formset.management_form }}