citizenlabsgr / citizenlabsgr/elections-api
Return 404 on unknown queries
Open
enhancement
- Dominant language
- Python
- Stars
- 12
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
We should only return an empty response when we recognize all parts of a query.
These queries should return a `404` with an error message:
- `/api/ballots/?election_id=999999`
- `/api/ballots/?precinct_county="Not A Real Place"`
Contributor guide
Research direction
Start by tracing the /api/ballots/ entry point and how election_id and precinct_county filters are handled. Confirm the current behavior for the two example queries, then make unknown election or location values return a 404 with an error message while recognized empty results remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100