hooks/syncschema.py
branchstable
changeset 9565 fa00fc251d57
parent 9559 072429be2d95
child 9600 bde625698f44
--- a/hooks/syncschema.py	Mon Mar 10 16:07:41 2014 +0100
+++ b/hooks/syncschema.py	Mon Mar 10 15:17:50 2014 +0100
@@ -1168,12 +1168,11 @@
         if self._cw.deleted_in_transaction(self.eidfrom):
             return
         schema = self._cw.vreg.schema
-        entity = self._cw.entity_from_eid(self.eidto)
         rdef = schema.schema_by_eid(self.eidfrom)
         try:
-            cstr = rdef.constraint_by_type(entity.type)
-        except IndexError:
-            self._cw.critical('constraint type no more accessible')
+            cstr = rdef.constraint_by_eid(self.eidto)
+        except ValueError:
+            self._cw.critical('constraint no more accessible')
         else:
             CWConstraintDelOp(self._cw, rdef=rdef, oldcstr=cstr)