server/repository.py
branchstable
changeset 7898 405017c79b45
parent 7895 0a967180794b
child 7907 08320697ca1a
child 7922 d307c3817782
--- 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)