Calculate total for crawl QA page endpoint (#2435)

Fixes #2434 

Patch fix for a regression in Browsertrix 1.4.0-1.4.1 where total was
not being calculated for QA page list endpoint but still being included
in response, which led to total always being 0 and pages not loading in
the frontend review screen as a result.
This commit is contained in:
Tessa Walsh 2025-02-27 14:46:35 -05:00 committed by GitHub
parent 376c9981dc
commit 45aa0a32b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View File

@ -1404,6 +1404,7 @@ def init_pages_api(
page=page, page=page,
sort_by=sortBy, sort_by=sortBy,
sort_direction=sortDirection, sort_direction=sortDirection,
include_total=True,
) )
return paginated_format(pages, total, page, pageSize) return paginated_format(pages, total, page, pageSize)

View File

@ -254,6 +254,7 @@ def test_qa_page_data(
headers=crawler_auth_headers, headers=crawler_auth_headers,
) )
data = r.json() data = r.json()
assert data["total"] == 1
assert len(data["items"]) == 1 assert len(data["items"]) == 1
page = data["items"][0] page = data["items"][0]