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):
|
def dispatch_request(self):
|
||||||
dispatch = super().dispatch_request()
|
dispatch = super().dispatch_request()
|
||||||
if dispatch.status_code == 302:
|
if dispatch:
|
||||||
return dispatch
|
return dispatch
|
||||||
|
|
||||||
# lot_id = self.form.lot.data
|
# lot_id = self.form.lot.data
|
||||||
# FIXME
|
# FIXME
|
||||||
# import pdb; pdb.set_trace()
|
# import pdb; pdb.set_trace()
|
||||||
self.get_context(None)
|
self.get_context(None)
|
||||||
|
self.context['form_new_allocate'] = self.form
|
||||||
return flask.render_template(self.template_name, **self.context)
|
return flask.render_template(self.template_name, **self.context)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
{{ field.label(class_="form-label") }}
|
{{ field.label(class_="form-label") }}
|
||||||
{{ field(class_="form-control") }}
|
{{ field(class_="form-control") }}
|
||||||
{% if field.errors %}
|
{% if field.errors %}
|
||||||
<p class="text-danger {% if field.errors %}field-error{% endif %}">
|
<p class="text-danger">
|
||||||
{% for error in field.errors %}
|
{% for error in field.errors %}
|
||||||
{{ error }}<br/>
|
{{ error }}<br/>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
Reference in New Issue