fix: Improve pagination calculation in projects search
Uses ceiling division to ensure complete pages are accounted for when returning project results. This prevents loss of data when the total number of projects is not perfectly divisible by the results per page.
This commit is contained in:
parent
9f22361aa9
commit
289240161c
1 changed files with 2 additions and 1 deletions
|
@ -4,6 +4,7 @@ from bs4 import BeautifulSoup
|
|||
import re
|
||||
import logging
|
||||
import json
|
||||
import math
|
||||
from flask import request, render_template, abort
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
|
@ -414,7 +415,7 @@ def projects_search(
|
|||
|
||||
logging.debug(f"Got {len(project_ibles)} projects")
|
||||
|
||||
return project_ibles, project_obj["out_of"]
|
||||
return project_ibles, math.ceil(project_obj["found"] / per_page)
|
||||
|
||||
|
||||
def update_data(app):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue