pallets-eco / flask-admin

Simple and extensible administrative interface framework for Flask
BSD 3-Clause "New" or "Revised" License
5.69k stars 1.56k forks source link

`can_set_page_size` does not prevent custom page sizes #2430

Open samuelhwilliams opened 1 month ago

samuelhwilliams commented 1 month ago

I'm not sure if this is just an incorrect assumption on my part, but my understanding was that can_set_page_size would prevent a user from customising the page size away from the default.

It looks like all it does it stop the page size dropdown rendering on the page, but that if you put page_size in the URL params directly you can still customise the page size.

I'm only playing with flask-admin for now, but I decided to toggle can_set_page_size = False on one of the views because I'm listing a number of related fields on the list display, which is causing the number of SQL queries to scale linearly with the number of results displayed. While it would be nice to fix that separately (if possible), it feels like the obvious behaviour of can_set_page_size is to actually stop the user from changing it.

Is the current behaviour intentional, or accidental?