cubicweb/entities/adapters.py
changeset 11129 97095348b3ee
parent 11107 df1f2d853d40
parent 11057 0b59724cb3f2
child 11358 179b5ff3f428
equal deleted inserted replaced
11128:9b4de34ad394 11129:97095348b3ee
   421                 continue
   421                 continue
   422             break
   422             break
   423         else:
   423         else:
   424             assert 0
   424             assert 0
   425         key = rschema.type + '-subject'
   425         key = rschema.type + '-subject'
   426         msg, args = constraint.failed_message(key, self.entity.cw_edited[rschema.type])
   426         # use .get since a constraint may be associated to an attribute that isn't edited (e.g.
       
   427         # constraint between two attributes). This should be the purpose of an api rework at some
       
   428         # point, we currently rely on the fact that such constraint will provide a dedicated user
       
   429         # message not relying on the `value` argument
       
   430         msg, args = constraint.failed_message(key, self.entity.cw_edited.get(rschema.type))
   427         raise ValidationError(self.entity.eid, {key: msg}, args)
   431         raise ValidationError(self.entity.eid, {key: msg}, args)