diff --git a/ereuse_devicehub/inventory/views.py b/ereuse_devicehub/inventory/views.py index ea17d25f..0b3446c1 100644 --- a/ereuse_devicehub/inventory/views.py +++ b/ereuse_devicehub/inventory/views.py @@ -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) diff --git a/ereuse_devicehub/templates/inventory/allocate.html b/ereuse_devicehub/templates/inventory/allocate.html index 7b53744c..9c58f88b 100644 --- a/ereuse_devicehub/templates/inventory/allocate.html +++ b/ereuse_devicehub/templates/inventory/allocate.html @@ -25,7 +25,7 @@ {{ field.label(class_="form-label") }} {{ field(class_="form-control") }} {% if field.errors %} -

+

{% for error in field.errors %} {{ error }}
{% endfor %}