[PATCH] [views/startup] drop a duplicate rql query in manage view

Denis Laxalde denis.laxalde at logilab.fr
Thu Jun 28 10:34:23 CEST 2018


Philippe Pepiot a écrit :
> # HG changeset patch
> # User Philippe Pepiot <philippe.pepiot at logilab.fr>
> # Date 1530173835 -7200
> #      Thu Jun 28 10:17:15 2018 +0200
> # Node ID b570d3094e32262b058de7681612700b552249b3
> # Parent  58f05ffafeca7e53aa94f0bf711763973cdee778
> # Available At https://hg.logilab.org/review/cubicweb
> #              hg pull https://hg.logilab.org/review/cubicweb -r b570d3094e32
> [views/startup] drop a duplicate rql query in manage view
> 
> Counting entities in `nb` is already done above this code, regression introduced by a85db6fa

Applied, thanks.

> diff --git a/cubicweb/web/views/startup.py b/cubicweb/web/views/startup.py
> --- a/cubicweb/web/views/startup.py
> +++ b/cubicweb/web/views/startup.py
> @@ -131,7 +131,6 @@ class ManageView(StartupView):
>                  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' <a href="%s">%s</a> (%d)' % (
>                  xml_escape(url), label, nb)
> 


More information about the cubicweb-devel mailing list