From 00217c6393a3d74b053d80a1c9dba108e19c197b Mon Sep 17 00:00:00 2001 From: Haresh Kainth Date: Wed, 16 Oct 2024 12:02:11 +0100 Subject: [PATCH] fix:add results_count to pagination context Included the total number of results in the pagination context by adding a count of the paginated documents. This ensures that the user interface can display the exact number of results on the current page. --- orp/orp_search/public_gateway.py | 1 + 1 file changed, 1 insertion(+) diff --git a/orp/orp_search/public_gateway.py b/orp/orp_search/public_gateway.py index 7c82a94..9128804 100644 --- a/orp/orp_search/public_gateway.py +++ b/orp/orp_search/public_gateway.py @@ -87,6 +87,7 @@ def finalise_results( context["paginator"] = paginator context["is_paginated"] = paginator.num_pages > 1 context["results"] = paginated_documents + context["results_count"] = len(paginated_documents) context["results_total_count"] = paginator.count context["results_page_total"] = paginator.num_pages context["current_page"] = config.offset