Closed teresantns closed 2 years ago
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.
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
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.
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.