# HG changeset patch # User Pierre-Yves David # Date 1364467517 -3600 # Node ID d8b0984c923c45e9be2ef499d4d1f7d31dfd2a85 # Parent 88c71ad83d47b38367d2ccd3cee1a980b40009ff [migration] fix bug in `CWAttributeAddOp.revertprecommit_event` The `rdefdef` attribute is set during the operation execution. In some the operation crash before this assignment. In such case `revertprecommit` raise an attribute error crashing the whole process and shadowing the original error. This changeset detect and Avoid this situation. diff -r 88c71ad83d47 -r d8b0984c923c hooks/syncschema.py --- a/hooks/syncschema.py Thu Mar 21 18:13:31 2013 +0100 +++ b/hooks/syncschema.py Thu Mar 28 11:45:17 2013 +0100 @@ -507,6 +507,8 @@ def revertprecommit_event(self): # revert changes on in memory schema + if getattr(self, 'rdefdef', None) is None: + return self.session.vreg.schema.del_relation_def( self.rdefdef.subject, self.rdefdef.name, self.rdefdef.object) # XXX revert changes on database