-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Browsable api raises AttributeError when posting raw data not containing data for nested serializer #3260
Comments
Okay, believe this is now resolved in master, to be released as 3.2.2 either today or later this week. Desperately need some good tests around all this but this quick fix will need to do for now. |
@jgadelange Gotcha - best thing would probably be to go ahead with that pull request then. |
Hmmmm... when testing this some more I found an other error. When leaving out a required field the
|
I seeing this in
And this is |
@tomchristie I think this issue still exists as the description above also matches my scenario. |
Able to replicate it in a super slimmed-down example case? |
@tomchristie https://www.dropbox.com/s/vm6denvw9depy5s/mysite.zip?dl=0 |
I can still reproduce it in 3.5.4. Models:
Serializers:
A simple viewset to try it:
Then you just need to make a POST request only containing {} with Browsable. |
Tested on one of my project with latest released DRF and got a correct response:
|
When I post an empty object (
{}
) using the raw data form in the browsable API I get anAttributeError
, when I have a nested serializer defined on the serializer set for that view. Example code and stack trace can be found below.Example code:
The text was updated successfully, but these errors were encountered: