Commit 019ef186 authored by Vincent Pelletier's avatar Vincent Pelletier

Fix error log condition: length must be exactly 2 AND type must be either...

Fix error log condition: length must be exactly 2 AND type must be either tuple or list (a string of more than 2 chars was enough to avoid the error message).
Fix a typo in error message.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24586 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8478dae5
......@@ -692,7 +692,7 @@ class SQLDict(RAMDict, SQLBase):
return self._validate(activity_tool, message_uid=value)
def _validate_after_path_and_method_id(self, activity_tool, message, value):
if not isinstance(value, (tuple, list)) or len(value) < 2:
if not (isinstance(value, (tuple, list)) or len(value) == 2):
LOG('CMFActivity', WARNING,
'unable to recognize value for after_path_and_method_id: %r' % (value,))
return []
......
......@@ -546,9 +546,9 @@ class SQLQueue(RAMQueue, SQLBase):
return self._validate(activity_tool, message_uid=value)
def _validate_after_path_and_method_id(self, activity_tool, message, value):
if not isinstance(value, (tuple, list)) or len(value) < 2:
if not (isinstance(value, (tuple, list)) and len(value) == 2):
LOG('CMFActivity', WARNING,
'unable to recognize value for after_path_and_method: %r' % (value,))
'unable to recognize value for after_path_and_method_id: %r' % (value,))
return []
return self._validate(activity_tool, path=value[0], method_id=value[1])
......
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