You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I make a POST with an empty body to a view that is using a serializer that contains a BooleanField that has its default kwarg set to a callable, I am getting the following validation error returned:
{"flag":["\"<function <lambda> at 0x1069fbb18>\" is not a valid boolean."]}
Even though I am explicitly setting the content type in the request to application/json, the html.is_html_input method is returning true on the data dict. This causes the BooleanField.default_empty_html value to be returned from BooleanField.get_value. default_empty_html seems to be set to the Field's default value in this case which is the callable object. This produces a rather strange validation error message.
Seems related to #3811 and #3788.
When I make a POST with an empty body to a view that is using a serializer that contains a BooleanField that has its default kwarg set to a callable, I am getting the following validation error returned:
Even though I am explicitly setting the content type in the request to application/json, the
html.is_html_input
method is returning true on the data dict. This causes theBooleanField.default_empty_html
value to be returned fromBooleanField.get_value
.default_empty_html
seems to be set to the Field's default value in this case which is the callable object. This produces a rather strange validation error message.Failing test case here: #3891
The text was updated successfully, but these errors were encountered: