web/views/startup.py
changeset 4144 a85db6fa9814
parent 4045 f4a52abb6f4f
child 4183 b5aa030bb2f9
--- a/web/views/startup.py	Fri Dec 18 15:07:26 2009 +0100
+++ b/web/views/startup.py	Fri Dec 18 15:07:54 2009 +0100
@@ -133,7 +133,11 @@
             if eschema.final or not eschema.may_have_permission('read', req):
                 continue
             etype = eschema.type
-            label = display_name(req, etype, 'plural')
+            nb = req.execute('Any COUNT(X) WHERE X is %s' % etype)[0][0]
+            if nb > 1:
+                label = display_name(req, etype, 'plural')
+            else:
+                label = display_name(req, etype)
             nb = req.execute('Any COUNT(X) WHERE X is %s' % etype)[0][0]
             url = self._cw.build_url(etype)
             etypelink = u'&#160;<a href="%s">%s</a> (%d)' % (