-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
severity: mediumResults in substantial degraded or broken functionality for specfic workflowsResults in substantial degraded or broken functionality for specfic workflowsstatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Description
Deployment Type
Self-hosted
NetBox Version
v4.0.2
Python Version
3.10
Steps to Reproduce
- Create a new user account
- Visit a page that uses pagination. It should load properly.
- Open
/user/preferences/and click the "X" onPage length. - Click
Save. - Visit the page in step 2. An error should occur.
Expected Behavior
The page should load without an error.
Observed Behavior
<class 'TypeError'>
'<' not supported between instances of 'int' and 'str'
Python version: 3.10.14
NetBox version: 4.0.2
Plugins:
netbox_demo: 0.5.0
I believe this is because the paginate.per_page preference is an empty string:
GET /api/users/config/
{
"ui": {
"htmx_navigation": ""
},
"locale": {
"language": ""
},
"pagination": {
"per_page": "",
"placement": "bottom"
},
"data_format": "json"
}
Therefore, per_page is set to "" instead of config.PAGINATE_COUNT:
netbox/netbox/utilities/paginator.py
Line 90 in 4b2f26a
| per_page = request.user.config.get('pagination.per_page', config.PAGINATE_COUNT) |
Metadata
Metadata
Assignees
Labels
severity: mediumResults in substantial degraded or broken functionality for specfic workflowsResults in substantial degraded or broken functionality for specfic workflowsstatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application