Commit 347cac18 authored by Tristan Cavelier's avatar Tristan Cavelier Committed by Romain Courteaud

erp5_test_result: prevent crashing if client send string value

Sanitizing client data would help to prevent such issue.

/reviewed-on !92
parent f96ce9ff
......@@ -11,7 +11,11 @@ if test_result.getPortalType() == 'Test Result':
skips=0)
for line in test_result.objectValues(portal_type='Test Result Line'):
for prop in edit_kw:
try:
edit_kw[prop] = edit_kw[prop] + line.getProperty(prop, 0)
except TypeError as e:
context.log("", repr(e))
has_unknown_result = True
has_unknown_result = has_unknown_result or line.getStringIndex() == 'UNKNOWN'
if has_unknown_result or edit_kw['errors'] or edit_kw['failures']:
status = 'FAIL'
......
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