[web] don't link to None in author box (when author has been deleted) (closes #2409855) stable
authorArthur Lutz <arthur.lutz@logilab.fr>
Mon, 17 Sep 2012 14:39:29 +0200
branchstable
changeset 8745 00c5ea2a064a
parent 8744 2091d275fe5c
child 8753 b61a7c6352f2
[web] don't link to None in author box (when author has been deleted) (closes #2409855)
web/views/baseviews.py
--- a/web/views/baseviews.py	Tue Mar 19 18:20:57 2013 +0100
+++ b/web/views/baseviews.py	Mon Sep 17 14:39:29 2012 +0200
@@ -565,8 +565,9 @@
         w = self.w
         w(u'<ul class="boxListing">')
         for key in displayed:
-            w(u'<li>%s</li>\n' %
-              self.index_link(basepath, key, index[key]))
+            if key:
+                w(u'<li>%s</li>\n' %
+                  self.index_link(basepath, key, index[key]))
         if needmore:
             url = self._cw.build_url('view', vid=self.__regid__,
                                      rql=self.cw_rset.printable_rql())
@@ -616,6 +617,8 @@
         return (None, None)
 
     def index_link(self, basepath, key, items):
+        if key[0] is None:
+            return
         label = u'%s [%s]' % (key[0], len(items))
         etypes = set(entity.__regid__ for entity in items)
         vtitle = self._cw._('%(etype)s by %(author)s') % {