Use Paginator.get_page instead of Paginator.page

Avoid error on empty page
This commit is contained in:
Yingtong Li 2023-05-02 20:59:50 +10:00
parent 603e276bac
commit bd43db4e21
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -233,7 +233,7 @@ def budget_list(request):
budgets_filtered.append(revision) budgets_filtered.append(revision)
paginator = Paginator(budgets_filtered, 100) paginator = Paginator(budgets_filtered, 100)
page = paginator.page(int(request.GET.get('page', '1'))) page = paginator.get_page(int(request.GET.get('page', '1')))
# Categorise budgets # Categorise budgets
budgets_action = [] budgets_action = []
@ -603,7 +603,7 @@ def claim_list(request):
claims_filtered.append(claim) claims_filtered.append(claim)
paginator = Paginator(claims_filtered, 100) paginator = Paginator(claims_filtered, 100)
page = paginator.page(int(request.GET.get('page', '1'))) page = paginator.get_page(int(request.GET.get('page', '1')))
# Categorise claims # Categorise claims
claims_action = [] claims_action = []