[hooks] run cascading delete hook later
authorJulien Cristau <julien.cristau@logilab.fr>
Thu, 10 Apr 2014 15:03:01 +0200
changeset 9680 8fb8f001f4e2
parent 9679 a3a516cf8624
child 9681 5a59d9835371
[hooks] run cascading delete hook later Applications may have their own before_delete_entity hooks that rely on the composite relations still existing.
hooks/integrity.py
--- a/hooks/integrity.py	Thu Apr 10 13:54:31 2014 +0200
+++ b/hooks/integrity.py	Thu Apr 10 15:03:01 2014 +0200
@@ -318,6 +318,8 @@
     __select__ = hook.Hook.__select__ & composite_etype()
     events = ('before_delete_entity',)
     category = 'activeintegrity'
+    # give the application's before_delete_entity hooks a chance to run before we cascade
+    order = 99
 
     def __call__(self):
         eid = self.entity.eid