diff --git a/ereuse_devicehub/inventory/forms.py b/ereuse_devicehub/inventory/forms.py index 062d185c..0357e19f 100644 --- a/ereuse_devicehub/inventory/forms.py +++ b/ereuse_devicehub/inventory/forms.py @@ -684,6 +684,7 @@ class NewActionForm(ActionFormMix): class AllocateForm(ActionFormMix): + date = HiddenField('') start_time = DateField('Start time') end_time = DateField('End time', [validators.Optional()]) final_user_code = StringField( @@ -692,7 +693,7 @@ class AllocateForm(ActionFormMix): transaction = StringField( 'Transaction', [validators.Optional(), validators.length(max=50)] ) - end_users = IntegerField('End users', [validators.Optional()]) + end_users = IntegerField('Number of end users', [validators.Optional()]) def validate(self, extra_validators=None): if not super().validate(extra_validators): diff --git a/ereuse_devicehub/inventory/views.py b/ereuse_devicehub/inventory/views.py index a09f4f5b..70c058a4 100644 --- a/ereuse_devicehub/inventory/views.py +++ b/ereuse_devicehub/inventory/views.py @@ -326,7 +326,8 @@ class NewAllocateView(NewActionView, DeviceListMix): messages.error('Action {} error!'.format(self.form.type.data)) for k, v in self.form.errors.items(): value = ';'.join(v) - messages.error('Action Error {key}: {value}!'.format(key=k, value=value)) + key = self.form[k].label.text + messages.error('Action Error {key}: {value}!'.format(key=key, value=value)) next_url = self.get_next_url() return flask.redirect(next_url) diff --git a/ereuse_devicehub/templates/inventory/allocate.html b/ereuse_devicehub/templates/inventory/allocate.html index f611a763..2f036795 100644 --- a/ereuse_devicehub/templates/inventory/allocate.html +++ b/ereuse_devicehub/templates/inventory/allocate.html @@ -29,6 +29,9 @@ {% else %}
{{ field.label(class_="form-label") }} + {% if field == form_new_allocate.start_time %} + * + {% endif %} {{ field(class_="form-control") }} {% if field.errors %}