# HG changeset patch # User Aurelien Campeas # Date 1233144434 -3600 # Node ID c47229797d0d9c61df66050fbaf9f58b0fdc51cc # Parent 334df77b38f5746197f7853767ee12edc72caa70 python 2.4 compat diff -r 334df77b38f5 -r c47229797d0d web/views/tabs.py --- a/web/views/tabs.py Wed Jan 28 10:30:06 2009 +0100 +++ b/web/views/tabs.py Wed Jan 28 13:07:14 2009 +0100 @@ -29,7 +29,7 @@ """ w = w or self.w self.req.add_js('cubicweb.lazy.js') - eid = eid if eid else '' + eid = eid or '' w(u'
' % (vid, vid, eid)) if show_spinbox: w(u'' % vid) @@ -62,7 +62,7 @@ tab = default else: tab = activetab.value - return tab if tab in tabs else default + return tab in tabs and tab or default def prune_tabs(self, tabs): selected_tabs = [] @@ -118,7 +118,7 @@ def js_lazily(self, vid_eid): vid, eid = vid_eid.split('-') - rset = self.req.eid_rset(eid) if eid else None + rset = eid and self.req.eid_rset(eid) or None view = self.vreg.select_view(vid, self.req, rset) return self._set_content_type(view, view.dispatch())