[treeview] fix condition stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Wed, 01 Jul 2009 14:58:09 +0200
branchstable
changeset 2216 b44b06520ddc
parent 2215 b1977f5263ac
child 2217 3a8cee8f8778
[treeview] fix condition
web/views/treeview.py
--- a/web/views/treeview.py	Wed Jul 01 14:56:37 2009 +0200
+++ b/web/views/treeview.py	Wed Jul 01 14:58:09 2009 +0200
@@ -106,7 +106,8 @@
         liclasses = []
         is_last = row == len(self.rset) - 1
         is_open = self.open_state(entity.eid, treeid)
-        if not hasattr(entity, 'is_leaf') or entity.is_leaf():
+        is_leaf = not hasattr(entity, 'is_leaf') or entity.is_leaf()
+        if is_leaf:
             if is_last:
                 liclasses.append('last')
             w(u'<li class="%s">' % u' '.join(liclasses))
@@ -145,7 +146,7 @@
                 w(u'<ul class="placeholder"><li>place holder</li></ul>')
         # the local node info
         self.wview(vid, self.rset, row=row, col=col)
-        if is_open: # => not leaf => rql is defined
+        if is_open and not is_leaf: #  => rql is defined
             self.wview(parentvid, self.req.execute(rql), treeid=treeid, initial_load=False)
         w(u'</li>')