--- a/server/hooks.py Fri Jul 31 23:47:20 2009 +0200
+++ b/server/hooks.py Fri Jul 31 23:48:18 2009 +0200
@@ -168,7 +168,9 @@
def precommit_event(self):
session = self.session
- if not self.eid in session.transaction_data.get('pendingeids', ()):
+ # don't do anything if the entity is being created or deleted
+ if not (self.eid in session.transaction_data.get('pendingeids', ()) or
+ self.eid in session.transaction_data.get('neweids', ())):
etype = session.describe(self.eid)[0]
session.unsafe_execute('DELETE %s X WHERE X eid %%(x)s, NOT %s'
% (etype, self.relation),