reuse existing variable
This commit is contained in:
parent
2e5e77b4e5
commit
3abd4c4af9
|
@ -20,7 +20,7 @@ def list_purchases(request: HttpRequest) -> HttpResponse:
|
||||||
purchases = Purchase.objects.order_by("-date_purchased")
|
purchases = Purchase.objects.order_by("-date_purchased")
|
||||||
page_obj = None
|
page_obj = None
|
||||||
if int(limit) != 0:
|
if int(limit) != 0:
|
||||||
paginator = Paginator(Purchase.objects.order_by("-date_purchased"), limit)
|
paginator = Paginator(purchases, limit)
|
||||||
page_obj = paginator.get_page(page_number)
|
page_obj = paginator.get_page(page_number)
|
||||||
purchases = page_obj.object_list
|
purchases = page_obj.object_list
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue