mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 09:51:22 -06:00
Closes #11807: Restore default page size when navigating between views
This commit is contained in:
parent
ed77c03830
commit
cfa6b28ceb
@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
## v3.4.6 (FUTURE)
|
## v3.4.6 (FUTURE)
|
||||||
|
|
||||||
|
### Enhancements
|
||||||
|
|
||||||
|
* [#11807](https://github.com/netbox-community/netbox/issues/11807) - Restore default page size when navigating between views
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* [#11796](https://github.com/netbox-community/netbox/issues/11796) - When importing devices, restrict rack by location only if the location field is specified
|
* [#11796](https://github.com/netbox-community/netbox/issues/11796) - When importing devices, restrict rack by location only if the location field is specified
|
||||||
|
@ -24,7 +24,7 @@ PREFERENCES = {
|
|||||||
'pagination.per_page': UserPreference(
|
'pagination.per_page': UserPreference(
|
||||||
label=_('Page length'),
|
label=_('Page length'),
|
||||||
choices=get_page_lengths(),
|
choices=get_page_lengths(),
|
||||||
description=_('The number of objects to display per page'),
|
description=_('The default number of objects to display per page'),
|
||||||
coerce=lambda x: int(x)
|
coerce=lambda x: int(x)
|
||||||
),
|
),
|
||||||
'pagination.placement': UserPreference(
|
'pagination.placement': UserPreference(
|
||||||
|
@ -76,8 +76,6 @@ def get_paginate_count(request):
|
|||||||
if 'per_page' in request.GET:
|
if 'per_page' in request.GET:
|
||||||
try:
|
try:
|
||||||
per_page = int(request.GET.get('per_page'))
|
per_page = int(request.GET.get('per_page'))
|
||||||
if request.user.is_authenticated:
|
|
||||||
request.user.config.set('pagination.per_page', per_page, commit=True)
|
|
||||||
return _max_allowed(per_page)
|
return _max_allowed(per_page)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user