fix: use correct query param key for format in feeds_advanced#953
Conversation
Signed-off-by: Sanchit2662 <sanchit2662@gmail.com>
|
Hi @regulartim , please review the changes |
|
Hey @Sanchit2662 !
No you did not! Why did you check the box? |
|
You're right @regulartim , that's completely my mistake I shouldn't have checked that box when I hadn't actually written any tests. Sorry about that. Do you want me to add a test for the format query parameter now and then update the checklist honestly. |
No worries, but please be a little more thorough next time.
Yes, I think adding a test case is the right thing to do here. It should be a test that fails without your changes but passes with your fix in place. |
Signed-off-by: Sanchit2662 <sanchit2662@gmail.com>
Signed-off-by: Sanchit2662 <sanchit2662@gmail.com>
|
@regulartim , added the test case. |
…Bear-Project#953) * fix: use correct query param key for format in feeds_advanced Signed-off-by: Sanchit2662 <sanchit2662@gmail.com> * test: add tests for format query param in feeds_advanced Signed-off-by: Sanchit2662 <sanchit2662@gmail.com> * fix: disable DRF format query param override to avoid 404 on ?format=csv Signed-off-by: Sanchit2662 <sanchit2662@gmail.com> --------- Signed-off-by: Sanchit2662 <sanchit2662@gmail.com>
Description
I noticed that the feeds_advanced endpoint silently ignores the format query parameter — it always returns JSON no matter what you pass. The issue was a simple key mismatch: FeedRequestParams.init was reading format_ (with an underscore) from the query dict instead of format. This worked fine for the legacy feeds view since it explicitly injected the key as format_, but feeds_advanced passes request.query_params directly — so a user's ?format=csv was never picked up and it just fell back to json. I fixed it by changing the lookup key to format in both places and updated the docstring to match.
closes #949
Type of change
Checklist
Formalities
<feature name>. Closes #999develop.develop.Docs and tests
Ruff) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.