[manage view] filter before displaying anything avoid xhtml errors
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 09 Feb 2011 18:49:41 +0100
changeset 6966 0f45b1dad08d
parent 6964 4813efcee2c6
child 6967 07d889e3f35d
[manage view] filter before displaying anything avoid xhtml errors
web/views/startup.py
--- a/web/views/startup.py	Wed Feb 09 18:08:40 2011 +0100
+++ b/web/views/startup.py	Wed Feb 09 18:49:41 2011 +0100
@@ -62,15 +62,15 @@
             self.w(u'</ul>')
 
     def startup_views(self):
-        views = self._cw.vreg['views'].possible_views(self._cw, None)
+        views = [v for v in self._cw.vreg['views'].possible_views(self._cw, None)
+                 if v.category == 'startupview'
+                 or v.__regid__ not in self.skip_startup_views]
         if not views:
             return
         self.w(u'<div class="hr">&#160;</div>')
         self.w(u'<h2>%s</h2>\n' % self._cw._('Startup views'))
         self.w(u'<ul class="startup">')
         for v in sorted(views, key=lambda x: self._cw._(x.title)):
-            if v.category != 'startupview' or v.__regid__ in self.skip_startup_views:
-                continue
             self.w('<li><a href="%s">%s</a></li>' % (
                 xml_escape(v.url()), xml_escape(self._cw._(v.title).capitalize())))
         self.w(u'</ul>')