[ms, test] fix source deletion pb, detected by test since 7885:9454b7ef5ae4 stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 30 Sep 2011 11:16:29 +0200
branchstable
changeset 7898 405017c79b45
parent 7897 defac26f4151
child 7899 4f6ff757f83c
[ms, test] fix source deletion pb, detected by test since 7885:9454b7ef5ae4
server/repository.py
--- a/server/repository.py	Fri Sep 30 11:15:40 2011 +0200
+++ b/server/repository.py	Fri Sep 30 11:16:29 2011 +0200
@@ -1422,7 +1422,11 @@
             source = self.sources_by_uri[sourceuri]
             if source.should_call_hooks:
                 self.hm.call_hooks('before_delete_entity', session, entities=entities)
-            self._delete_info_multi(session, entities, sourceuri)
+            if session.deleted_in_transaction(source.eid):
+                # source is being deleted, think to give scleanup argument
+                self._delete_info_multi(session, entities, sourceuri, scleanup=source.eid)
+            else:
+                self._delete_info_multi(session, entities, sourceuri)
             source.delete_entities(session, entities)
             if source.should_call_hooks:
                 self.hm.call_hooks('after_delete_entity', session, entities=entities)