[hooks] don't insert use_email relation if the entity on either side is going away
Closes #4912946
--- a/hooks/email.py Fri Jan 16 10:57:02 2015 +0100
+++ b/hooks/email.py Fri Jan 16 17:48:16 2015 +0100
@@ -35,6 +35,10 @@
if self.email.eid == e.eid)
def precommit_event(self):
+ if self.cnx.deleted_in_transaction(self.entity.eid):
+ return
+ if self.cnx.deleted_in_transaction(self.email.eid):
+ return
if self.condition():
self.cnx.execute(
'SET X %s Y WHERE X eid %%(x)s, Y eid %%(y)s' % self.rtype,