From 2b4b469b0e2452ed7a651b064d952c7d4325e27c Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 2 Oct 2024 12:27:20 +0200 Subject: [PATCH] fix pagination in lots --- dashboard/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dashboard/views.py b/dashboard/views.py index 5384cc4..6153675 100644 --- a/dashboard/views.py +++ b/dashboard/views.py @@ -33,4 +33,5 @@ class LotDashboardView(InventaryMixin, DetailsMixin): def get_devices(self, user, offset, limit): chids = self.object.devicelot_set.all().values_list("device_id", flat=True).distinct() - return [Device(id=x) for x in chids], chids.count() + chids_page = chids[offset:offset+limit] + return [Device(id=x) for x in chids_page], chids.count()