[views] Add selector to avoid displaying the seda tree on multi-lines rset
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 10 Mar 2017 10:50:21 +0100
changeset 2480 904f78b40d55
parent 2477 b1ab49e7f058
child 2481 64ffda562109
[views] Add selector to avoid displaying the seda tree on multi-lines rset this causes an error during automatic tests, and we don't want that anyway.
cubicweb_seda/views/sedatree.py
--- a/cubicweb_seda/views/sedatree.py	Tue Mar 14 15:44:32 2017 +0100
+++ b/cubicweb_seda/views/sedatree.py	Fri Mar 10 10:50:21 2017 +0100
@@ -16,7 +16,7 @@
 """cubicweb-seda views for ArchiveUnit"""
 
 from cubicweb import _
-from cubicweb.predicates import adaptable, is_instance
+from cubicweb.predicates import adaptable, is_instance, one_line_rset
 from cubicweb.web import component
 
 from ..entities import simplified_profile, component_unit
@@ -26,7 +26,9 @@
 class ProfileTreeComponent(component.EntityCtxComponent):
     """Display the whole profile tree."""
     __regid__ = 'seda.tree'
-    __select__ = component.EntityCtxComponent.__select__ & adaptable('ITreeBase')
+    __select__ = (component.EntityCtxComponent.__select__
+                  & one_line_rset()
+                  & adaptable('ITreeBase'))
     context = 'left'
     order = -1
     title = _('SEDA profile tree')