# HG changeset patch # User Philippe Pepiot # Date 1490267399 -3600 # Node ID 245a4f81053b1fa1acfcbcd92ecf64c1158f6f81 # Parent 54b518367617814974a618bd0138ef70fd3f60c5 [web/views] display unique composite entities in deleteconf When the entity has two relations to the same composite, display it only once. diff -r 54b518367617 -r 245a4f81053b cubicweb/web/views/editforms.py --- a/cubicweb/web/views/editforms.py Thu Mar 23 11:47:59 2017 +0100 +++ b/cubicweb/web/views/editforms.py Thu Mar 23 12:09:59 2017 +0100 @@ -76,13 +76,16 @@ show_composite_skip_rtypes = set('wf_info_for',) def _iter_composite_entities(self, entity, limit=None): + eids = set() for rdef, role in entity.e_schema.composite_rdef_roles: if rdef.rtype in self.show_composite_skip_rtypes: continue for centity in entity.related( rdef.rtype, role, limit=limit ).entities(): - yield centity + if centity.eid not in eids: + eids.add(centity.eid) + yield centity def call(self, onsubmit=None): """ask for confirmation before real deletion"""