cubicweb/hooks/integrity.py
changeset 11765 9cb215e833b0
parent 11366 80dec361a5d0
child 11767 432f87a63057
equal deleted inserted replaced
11764:6ab14a1afb65 11765:9cb215e833b0
    85             if eid in pendingeids:
    85             if eid in pendingeids:
    86                 continue
    86                 continue
    87             if rtype in pendingrtypes:
    87             if rtype in pendingrtypes:
    88                 continue
    88                 continue
    89             if not cnx.execute(self.base_rql % rtype, {'x': eid}):
    89             if not cnx.execute(self.base_rql % rtype, {'x': eid}):
    90                 etype = cnx.entity_metas(eid)['type']
    90                 etype = cnx.entity_type(eid)
    91                 msg = _('at least one relation %(rtype)s is required on '
    91                 msg = _('at least one relation %(rtype)s is required on '
    92                         '%(etype)s (%(eid)s)')
    92                         '%(etype)s (%(eid)s)')
    93                 raise validation_error(eid, {(rtype, self.role): msg},
    93                 raise validation_error(eid, {(rtype, self.role): msg},
    94                                        {'rtype': rtype, 'etype': etype, 'eid': eid},
    94                                        {'rtype': rtype, 'etype': etype, 'eid': eid},
    95                                        ['rtype', 'etype'])
    95                                        ['rtype', 'etype'])