Closed chrisvanrun closed 1 week ago
Having looked at it a bit more, I've concluded it is only the CIVSet list view that does a permission check per row.
I have a branch ready that builds on:
Waiting for that PR to be merged and rebasing the branch + creating a PR then.
Nearly all
PaginatedTableListView
use a construct like this to retrieve the permissions:This entails that every row render hits the database. This inefficiency is hidden from the debug toolbar because the rows are rendered in a secondary query from the initial loading page.
An easy fix would be to add a checker that gets to prefetch the permissions, much like used here:
https://github.com/comic/grand-challenge.org/blob/c548f50ffdd4e449e435487f83ac509b09b48775/app/grandchallenge/publications/views.py#L42-L50