fix error message in form

This commit is contained in:
Cayo Puigdefabregas 2022-02-02 14:17:42 +01:00
parent 71f5a8a98b
commit c0918e7b57
2 changed files with 3 additions and 2 deletions

View File

@ -297,13 +297,14 @@ class NewAllocateView(NewActionView, DeviceListMix):
def dispatch_request(self):
dispatch = super().dispatch_request()
if dispatch.status_code == 302:
if dispatch:
return dispatch
# lot_id = self.form.lot.data
# FIXME
# import pdb; pdb.set_trace()
self.get_context(None)
self.context['form_new_allocate'] = self.form
return flask.render_template(self.template_name, **self.context)

View File

@ -25,7 +25,7 @@
{{ field.label(class_="form-label") }}
{{ field(class_="form-control") }}
{% if field.errors %}
<p class="text-danger {% if field.errors %}field-error{% endif %}">
<p class="text-danger">
{% for error in field.errors %}
{{ error }}<br/>
{% endfor %}