[web/views] delete: show composite entities in predictible order 3.25
authorPhilippe Pepiot <philippe.pepiot@logilab.fr>
Fri, 05 May 2017 17:57:10 +0200
branch3.25
changeset 12184 cd940ebefc4e
parent 12166 a33c2b8d183b
child 12185 c46f2bf815d2
[web/views] delete: show composite entities in predictible order Iterate over relations type in alphabetical order, so the order is predictible dans does not depend on PYTHONHASHSEED.
cubicweb/web/views/editforms.py
--- a/cubicweb/web/views/editforms.py	Wed Apr 19 11:10:58 2017 +0200
+++ b/cubicweb/web/views/editforms.py	Fri May 05 17:57:10 2017 +0200
@@ -77,7 +77,8 @@
 
     def _iter_composite_entities(self, entity, limit=None):
         eids = set()
-        for rdef, role in entity.e_schema.composite_rdef_roles:
+        for rdef, role in sorted(entity.e_schema.composite_rdef_roles,
+                                 key=lambda x: x[0].rtype):
             if rdef.rtype in self.show_composite_skip_rtypes:
                 continue
             for centity in entity.related(