fieldingstats.get_fieldingstats: count computed after limit applied #100
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/major-domo-database#100
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
In
app/routers_v3/fieldingstats.py, theget_fieldingstatsendpoint calls.count()after.limit()is applied to the queryset. This means thecountfield in the response is capped at the limit value (200 by default) rather than reflecting the total number of matching records.Expected Behavior
countshould 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 usetotal_countin the response dict.Found during review of PR #99 (limit caps). Will be fixed in that PR.