From 8e48f924538358026eb726775b8b280acf73b645 Mon Sep 17 00:00:00 2001
From: Nicolas Delaby <nicolas@nexedi.com>
Date: Wed, 12 Sep 2007 14:53:45 +0000
Subject: [PATCH] add tag in activity, raise KeyError when Subscription is
 misconfigured

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16302 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5SyncML/Subscription.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/product/ERP5SyncML/Subscription.py b/product/ERP5SyncML/Subscription.py
index 093a1bbfd0b..0069f367d72 100644
--- a/product/ERP5SyncML/Subscription.py
+++ b/product/ERP5SyncML/Subscription.py
@@ -1106,12 +1106,14 @@ class Subscription(Folder, XMLSyncUtils):
         query_list = query_method(**kw)
       else:
         LOG('This Subscriber %s provide no Query with id :' % (self.getTitle()), INFO, query)
+        raise KeyError
     elif callable(query): # used in the test
       query_list = query(destination)
     else:
       LOG('This Subscriber %s provide no Query with id :' % (self.getTitle()), INFO, query)
+      raise KeyError
     return [x for x in query_list
-              if not getattr(x,'_conflict_resolution', False)]
+              if not getattr(x, '_conflict_resolution', False)]
 
   def generateNewIdWithGenerator(self, object=None, gid=None):
     """
@@ -1342,7 +1344,8 @@ class Subscription(Folder, XMLSyncUtils):
     object_list_len = len(object_id_list)
     for i in xrange(0, object_list_len, 100):
       current_id_list = object_id_list[i:i+100]
-      self.activate(activity='SQLQueue').manage_delObjects(current_id_list)
+      self.activate(activity='SQLQueue',
+                          tag = self.getId()).manage_delObjects(current_id_list)
 
   def getConflictList(self):
     """
-- 
2.30.9