Commit 912d64b3 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Catch KeyError in the validator, because KeyError seems to be caught and...

Catch KeyError in the validator, because KeyError seems to be caught and ignored at somewhere, and disappear on the screen. So it is translated into ValidationError somehow. Typically, this error happens when there is any editable column which does not appear in columns.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32492 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9d5b0893
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment