From ded4d3edf865f02e6152fc108ada6ccb3dbc19dd Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Thu, 15 Dec 2005 09:44:45 +0000
Subject: [PATCH] fixed bug when there an empty list for the value of
 after_path and after_method_id

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4663 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/CMFActivity/Activity/SQLDict.py | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/product/CMFActivity/Activity/SQLDict.py b/product/CMFActivity/Activity/SQLDict.py
index 4c00983763..0f01730855 100755
--- a/product/CMFActivity/Activity/SQLDict.py
+++ b/product/CMFActivity/Activity/SQLDict.py
@@ -472,20 +472,20 @@ class SQLDict(RAMDict):
     # Count number of occurances of method_id
     if type(value) == type(''):
       value = [value]
-    result = activity_tool.SQLDict_validateMessageList(method_id=value, message_uid=None, path=None)
-#     LOG('SQLDict._validate_after_method_id, method_id',0,value)
-#     LOG('SQLDict._validate_after_method_id, result[0].uid_count',0,result[0].uid_count)
-    if result[0].uid_count > 0:
-      return INVALID_ORDER
+    if len(value)>0: # if empty list provided, the message is valid
+      result = activity_tool.SQLDict_validateMessageList(method_id=value, message_uid=None, path=None)
+      if result[0].uid_count > 0:
+        return INVALID_ORDER
     return VALID
 
   def _validate_after_path(self, activity_tool, message, value):
     # Count number of occurances of path
     if type(value) == type(''):
       value = [value]
-    result = activity_tool.SQLDict_validateMessageList(method_id=None, message_uid=None, path=value)
-    if result[0].uid_count > 0:
-      return INVALID_ORDER
+    if len(value)>0: # if empty list provided, the message is valid
+      result = activity_tool.SQLDict_validateMessageList(method_id=None, message_uid=None, path=value)
+      if result[0].uid_count > 0:
+        return INVALID_ORDER
     return VALID
 
   def _validate_after_message_uid(self, activity_tool, message, value):
-- 
2.30.9