mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-10-31 22:19:00 +00:00
Use elided page range on user admin view
This commit is contained in:
parent
43202f5bb7
commit
61c2d2a36a
1 changed files with 6 additions and 2 deletions
|
@ -10,7 +10,7 @@ from bookwyrm import forms, models
|
|||
from bookwyrm.settings import PAGE_LENGTH
|
||||
|
||||
|
||||
# pylint: disable= no-self-use
|
||||
# pylint: disable=no-self-use
|
||||
@method_decorator(login_required, name="dispatch")
|
||||
@method_decorator(
|
||||
permission_required("bookwyrm.moderate_user", raise_exception=True),
|
||||
|
@ -55,8 +55,12 @@ class UserAdminList(View):
|
|||
users = users.order_by(sort)
|
||||
|
||||
paginated = Paginator(users, PAGE_LENGTH)
|
||||
page = paginated.get_page(request.GET.get("page"))
|
||||
data = {
|
||||
"users": paginated.get_page(request.GET.get("page")),
|
||||
"users": page,
|
||||
"page_range": paginated.get_elided_page_range(
|
||||
page.number, on_each_side=2, on_ends=1
|
||||
),
|
||||
"sort": sort,
|
||||
"server": server,
|
||||
"status": status,
|
||||
|
|
Loading…
Reference in a new issue