[integrity] skip auto-delete for internal sessions (but *not* for super session, see 4642:921737d2e3a8) stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 24 Feb 2010 11:21:51 +0100
branchstable
changeset 4687 082e66184f71
parent 4686 c55606a5c4b0
child 4688 6ea3a3b21c6a
[integrity] skip auto-delete for internal sessions (but *not* for super session, see 4642:921737d2e3a8)
server/repository.py
--- a/server/repository.py	Wed Feb 24 11:20:13 2010 +0100
+++ b/server/repository.py	Wed Feb 24 11:21:51 2010 +0100
@@ -102,10 +102,11 @@
     hooks order hazardness
     """
     # XXX now that rql in migraction default to unsafe_execute we don't want to
-    #     skip that anymore. Also we should imo rely on the orm to first fetch
-    #     existing entity if any then delete it
-    #if session.is_super_session:
-    #    return
+    #     skip that for super session (though we can still skip it for internal
+    #     sessions). Also we should imo rely on the orm to first fetch existing
+    #     entity if any then delete it.
+    if session.is_internal_session:
+        return
     card = session.schema_rproperty(rtype, eidfrom, eidto, 'cardinality')
     # one may be tented to check for neweids but this may cause more than one
     # relation even with '1?'  cardinality if thoses relations are added in the