From 3abd4c4af91ec3cfb7b848436e718a103267b90d Mon Sep 17 00:00:00 2001 From: Lukas Kucharczyk Date: Fri, 9 Aug 2024 13:59:14 +0200 Subject: [PATCH] reuse existing variable --- games/purchaseviews.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/games/purchaseviews.py b/games/purchaseviews.py index a4fbbbb..f073dd0 100644 --- a/games/purchaseviews.py +++ b/games/purchaseviews.py @@ -20,7 +20,7 @@ def list_purchases(request: HttpRequest) -> HttpResponse: purchases = Purchase.objects.order_by("-date_purchased") page_obj = None if int(limit) != 0: - paginator = Paginator(Purchase.objects.order_by("-date_purchased"), limit) + paginator = Paginator(purchases, limit) page_obj = paginator.get_page(page_number) purchases = page_obj.object_list