cut number of queries for anonymous browsing
cut number of queries for anonymous browsing

For a single request to http://127.0.0.1:8000/QEMU/ we get 78
SQL queries, and 50 of them are checking whether the project is
maintained by the current logged in user.  Certainly caching the
answer is a possibility, but really an anonymous user is never
going to be a maintainer.  Adding the check to maintained_by
cuts the queries from 78 to 28 and the processing time from
12 to 7 ms.

Signed-off-by: Paolo Bonzini <69d3ebcf5ee4e7f05a50dc23cd96655b730804b4@redhat.com>
Message-Id: <20180502152750.1224-1-69d3ebcf5ee4e7f05a50dc23cd96655b730804b4@redhat.com>
Signed-off-by: Fam Zheng <df9fd617995bad07eac70e27aa3fe5069270e3bd@redhat.com>

pvital/patchew,pvital/patchew,pvital/patchew,pvital/patchew