Skip to content

Commit

Permalink
refactor:context variables for search pagination
Browse files Browse the repository at this point in the history
Consolidate the context dictionary by removing redundant variables and clarifying names. This change simplifies the code and ensures that relevant pagination information is correctly passed to the template.
  • Loading branch information
hareshkainthdbt committed Oct 16, 2024
1 parent 7347649 commit 4b87570
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions orp/orp_search/public_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,10 @@ def finalise_results(
).split("\n")

# Pass the paginated results to the template
context["paginator"] = paginator
context["is_paginated"] = paginator.num_pages > 1
context["results"] = paginated_documents
context["documents"] = paginated_documents
context["paginator"] = paginator
context["page_obj"] = paginated_documents
context["results_count"] = paginator.count
context["results_total_count"] = paginator.count
context["results_page_total"] = paginator.num_pages
context["current_page"] = config.offset
return context
Expand Down

0 comments on commit 4b87570

Please sign in to comment.