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:
Kumi 2025-01-31 08:40:19 +01:00
parent 9f22361aa9
commit 289240161c
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -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):