diff -r 215403b9798f -r 116b24efad0e hooks/metadata.py --- a/hooks/metadata.py Thu Jan 29 16:18:23 2015 +0100 +++ b/hooks/metadata.py Thu Jan 15 15:45:09 2015 +0100 @@ -93,6 +93,10 @@ class SyncOwnersOp(hook.DataOperationMixIn, hook.Operation): def precommit_event(self): for compositeeid, composedeid in self.get_data(): + if self.cnx.deleted_in_transaction(compositeeid): + continue + if self.cnx.deleted_in_transaction(composedeid): + continue self.cnx.execute('SET X owned_by U WHERE C owned_by U, C eid %(c)s,' 'NOT EXISTS(X owned_by U, X eid %(x)s)', {'c': compositeeid, 'x': composedeid})