fix error message in form
This commit is contained in:
parent
71f5a8a98b
commit
c0918e7b57
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
@ -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 %}
|
||||
|
|
Reference in New Issue