fieldingstats.get_fieldingstats: count computed after limit applied #100

Closed
opened 2026-04-01 22:39:38 +00:00 by cal · 0 comments
Owner

Problem

In app/routers_v3/fieldingstats.py, the get_fieldingstats endpoint calls .count() after .limit() is applied to the queryset. This means the count field in the response is capped at the limit value (200 by default) rather than reflecting the total number of matching records.

Expected Behavior

count should reflect the total matching rows before pagination, consistent with every other paginated endpoint.

Fix

Capture total_count = all_stats.count() before the .limit() call, then use total_count in the response dict.

Found during review of PR #99 (limit caps). Will be fixed in that PR.

## Problem In `app/routers_v3/fieldingstats.py`, the `get_fieldingstats` endpoint calls `.count()` after `.limit()` is applied to the queryset. This means the `count` field in the response is capped at the limit value (200 by default) rather than reflecting the total number of matching records. ## Expected Behavior `count` should reflect the total matching rows before pagination, consistent with every other paginated endpoint. ## Fix Capture `total_count = all_stats.count()` before the `.limit()` call, then use `total_count` in the response dict. Found during review of PR #99 (limit caps). Will be fixed in that PR.
cal closed this issue 2026-04-01 22:44:43 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/major-domo-database#100
No description provided.