This commit is contained in:
Kenneth Kehl
2025-01-30 14:52:48 -08:00
parent 2dc07b9cee
commit 6d82567b0e
3 changed files with 12 additions and 12 deletions

View File

@@ -281,12 +281,16 @@ def get_recent_notifications_for_job(
)
stmt = _filter_query(stmt, filter_dict)
stmt = stmt.order_by(desc(Notification.job_row_number))
print(f"STMT {stmt}")
results = db.session.execute(stmt).scalars().all()
print(f"RESULTS {results}")
page_size = current_app.config["PAGE_SIZE"]
offset = (page - 1) * page_size
paginated_results = results[offset : offset + page_size]
print(
f"PAGINATED RESULTS {paginated_results} page_size {page_size} offset {offset}"
)
pagination = Pagination(paginated_results, page, page_size, len(results))
return pagination