diff --git a/product/ERP5Form/ListBox.py b/product/ERP5Form/ListBox.py index 280b64030e0741cbd53c469fe8300da7004efe3d..33993792f3b42dc15362139af34411fa3c0c2fda 100644 --- a/product/ERP5Form/ListBox.py +++ b/product/ERP5Form/ListBox.py @@ -2545,6 +2545,8 @@ class ListBoxListRenderer(ListBoxRenderer): class ListBoxValidator(Validator.Validator): property_names = Validator.Validator.property_names + message_names = Validator.Validator.message_names + ['required_not_found'] + required_not_found = 'Input is required but no input given.' def validate(self, field, key, REQUEST): form = field.aq_parent @@ -2660,6 +2662,10 @@ class ListBoxValidator(Validator.Validator): #LOG("ListBox ValidationError",0,str(err)) err.field_id = error_result_key errors.append(err) + except KeyError: + err = ValidationError('required_not_found', field) + err.field_id = field.id + errors.append(err) else: # Second case: modification of existing objects #try: @@ -2710,6 +2716,10 @@ class ListBoxValidator(Validator.Validator): #LOG("ListBox ValidationError",0,str(err)) err.field_id = error_result_key errors.append(err) + except KeyError: + err = ValidationError('required_not_found', field) + err.field_id = field.id + errors.append(err) #except: else: LOG("ListBox WARNING",0,"Object uid %s could not be validated" % uid)