-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
RelatedField(required=False) throws KeyError when the data is missing #3985
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
Comments
Can you try this with allow_null please? allow_empty is for lists |
I'm a bit mixed on that one but would tend to consider that valid. |
@carltongibson actually looks like neither |
@nazarewk not really it's a different thing. |
Well it feels weird for me to set the fields in either |
OK. This does seems a problem:
We get the |
I have this problem too. behavior: #3984 looks good ! |
Okay, thanks for the data point - we'll try to get this reviewed soon. |
Closing with same resolution as #3984. Happy to reconsider if anyone believes that resolution isn't correct/sufficient. |
Checklist
master
branch of Django REST framework.Actually there is a duplicate but without a valid use case.
User story
I want to fill in the non-nullable relational field on the
Model
(eg. insave()
), i would make itrequired=False
in the DRF to allow it.Steps to reproduce
Expected behavior
Actual behavior
The text was updated successfully, but these errors were encountered: