-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MAX_PAGE_SIZE setting #9107
base: master
Are you sure you want to change the base?
Add MAX_PAGE_SIZE setting #9107
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this deserve a test case,, but as it is adding/exposing new API surface to the framework, we might need to pass the design decision step first
OK I saw the comment now #6185 (comment) it might be possible in class level but not globally at the moment. |
@auvipy I added tests for system checks, but didn't managed to find and add tests for settings with API requests like in |
we got a PR related to this area #8993. would be helpful if you review and share your views on the PR. |
@auvipy @christophehenry @TheSuperiorStanislav If you don't mind, I can take this up and implement the changes requested |
Co-authored-by: Roman Gorbil <roman.gorbil@saritasa.com>
456a1fe
to
b51141c
Compare
@auvipy @christophehenry Could you please take a look? Sorry for taking that long, btw 🥲 |
def page_size(self) -> int: | ||
"""Get default page size. | ||
|
||
Defaults to `None`, meaning pagination is disabled. | ||
|
||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There shoud probably be a comment explaining why this i a property to avoid removing it in a future refactor?
Looks good to me. Thank you. |
Description
Add a setting for max page size for global pagination. Our team discovered that by default, page size is unlimited which could lead to API abuse and the only way to fix it -> it's to subclass pagination class(which is a working solution, but not convenient). After investigating issues I found related issue and comment.