server/hooks.py
changeset 2745 0dafa29ace1f
parent 2695 56439c45781c
child 2778 3f6dfc312760
child 2908 1c42a9826dd4
--- a/server/hooks.py	Fri Aug 07 17:40:52 2009 +0200
+++ b/server/hooks.py	Fri Aug 07 17:42:04 2009 +0200
@@ -313,6 +313,9 @@
     if rtype in DONT_CHECK_RTYPES_ON_DEL:
         return
     card = rproperty(session, rtype, eidfrom, eidto, 'cardinality')
+    pendingrdefs = session.transaction_data.get('pendingrdefs', ())
+    if (session.describe(eidfrom)[0], rtype, session.describe(eidto)[0]) in pendingrdefs:
+        return
     pendingeids = session.transaction_data.get('pendingeids', ())
     if card[0] in '1+' and not eidfrom in pendingeids:
         checkrel_if_necessary(session, CheckSRelationOp, rtype, eidfrom)