-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Labels
Milestone
Description
Summary
A committee profile page can return 404 even when the committee exists in the API, if /committee/<committee_id>/history/ includes last_cycle_has_financial or cycles_has_financial for a cycle that has no data at /committee/<committee_id>/history/<cycle>/.
Example:
- Committee page:
/data/committee/C70004569/ - Summary history endpoint returns the committee and has
2034:https://api.open.fec.gov/v1/committee/C70004569/history?per_page=1&api_key=DEMO_KEY
- Cycle-specific history endpoint for that cycle returns no data:
https://api.open.fec.gov/v1/committee/C70004569/history/2034?per_page=1&api_key=DEMO_KEY
Current CMS behavior in fec/data/views.py:
- Load
/committee/C70004569/history/ - Read
last_cycle_has_financial == 2034 - Request
/committee/C70004569/history/2034 - Raise
Http404when that endpoint returns no row
What should have happened?
The committee profile should render because the committee exists. If the cycle-specific history row is missing for a cycle, the page should fall back to the summary committee record and show the existing "missing financials" state instead of returning 404.
Frequency
Ongoing for any committee where the summary history endpoint has a cycle that the cycle-specific history endpoint does not actually return.
Suggested fix:
- Do not raise
Http404solely because/committee/<committee_id>/history/<cycle>is empty when/committee/<committee_id>/history/already returned the committee. - Fall back to the summary history record and allow the existing missing-financials UI to handle the inconsistent cycle data.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
🔨 Pre-refinement