Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blank checkbox on referral on PUT method gives MultiValueDictKeyError #10

Closed
teresantns opened this issue Dec 23, 2021 · 2 comments
Closed
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@teresantns
Copy link
Owner

teresantns commented Dec 23, 2021

Related to #4

In the endpoint designed for accepting a referral, currently trying to update the referral with an empty checkbox on 'status' field (i.e. rejecting the referral) gives a MultiValueDictKeyError.

image
Example of put method which returns the error

Requests with the checkbox checked (meaning a true value on boolean field, ergo accepting the referral) don't return any error, and everything works as it should with the point system.

This may be related with this issue some people had with empty boolean fields.

@teresantns teresantns added bug Something isn't working urgent High priority tasks labels Dec 23, 2021
@teresantns teresantns added this to To do in Kanban Board via automation Dec 23, 2021
@teresantns
Copy link
Owner Author

This issue doesn't seem to happen with the JSON raw data method of request

image
Example of PUT method with raw JSON data, which doesn't return the error

Updating the referral instance this way doesn't return any errors, and everything works as expected.

@teresantns teresantns removed the urgent High priority tasks label Dec 23, 2021
@teresantns
Copy link
Owner Author

teresantns commented Dec 23, 2021

After some research, I found that this behaviour is due to the way boolean fields work in HTML, as mentioned by the comments on a discussion revolving the same issue.

Since the API endpoint works as expected with the request in JSON form, this is not a bug that damages the behaviour of the referral acceptance. Nevertheless, it is probably something that would likely have to be addressed by the front end team, or be noticed while building a enhanced page for this endpoint

Kanban Board automation moved this from To do to Done Dec 23, 2021
@teresantns teresantns added the wontfix This will not be worked on label Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
Development

No branches or pull requests

1 participant