cubicweb/web/views/autoform.py
branch3.26
changeset 12677 9f03df82f8de
parent 12676 c96aa316d06b
child 12709 280c9db41038
equal deleted inserted replaced
12676:c96aa316d06b 12677:9f03df82f8de
   869         """return a list of (relation schema, role) to edit for the entity"""
   869         """return a list of (relation schema, role) to edit for the entity"""
   870         if self.display_fields is not None:
   870         if self.display_fields is not None:
   871             schema = self._cw.vreg.schema
   871             schema = self._cw.vreg.schema
   872             for rtype, role in self.display_fields:
   872             for rtype, role in self.display_fields:
   873                 yield (schema[rtype], role)
   873                 yield (schema[rtype], role)
       
   874             return
   874         if self.edited_entity.has_eid() and not self.edited_entity.cw_has_perm('update'):
   875         if self.edited_entity.has_eid() and not self.edited_entity.cw_has_perm('update'):
   875             return
   876             return
   876         action = 'update' if self.edited_entity.has_eid() else 'add'
   877         action = 'update' if self.edited_entity.has_eid() else 'add'
   877         for rtype, _, role in self._relations_by_section('attributes', action, strict):
   878         for rtype, _, role in self._relations_by_section('attributes', action, strict):
   878             yield (rtype, role)
   879             yield (rtype, role)