π₯π₯π₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.
TypeScript boardsbug-trackerdjangodockerganttissue-trackerjirajira-alternativekanbanlinearpostgresqlproduct-managementproject-managementproject-planningpythonreactredistypesciptvitework-management
[WEB-4418]fix: fixed the pagination for issues #7301
Bavisetti Narayane624a17868df
diff --git a/apiserver/plane/utils/paginator.py b/apiserver/plane/utils/paginator.pyindex 2b8c27f766..0793d2a30e 100644--- a/apiserver/plane/utils/paginator.py+++ b/apiserver/plane/utils/paginator.py@@ -150,6 +150,8 @@ class OffsetPaginator:raise BadPaginationError("Pagination offset cannot be negative")results = queryset[offset:stop]+ # Duplicate the queryset so it does not evaluate on any python ops+ page_results = queryset[offset:stop].values("id")# Only slice from the end if we're going backwards (previous page)if cursor.value != limit and cursor.is_prev:@@ -164,7 +166,7 @@ class OffsetPaginator:# Check if there are more results available after the current page# Adjust cursors based on the results for pagination- next_cursor = Cursor(limit, page + 1, False, len(results) > limit)+ next_cursor = Cursor(limit, page + 1, False, page_results.count() > limit)# If the page is greater than 0, then set the previous cursorprev_cursor = Cursor(limit, page - 1, True, page > 0)