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
Fix partial update for the ListSerializer. #4222
Conversation
Current coverage is 91.54%
|
Additional fix partial update for the ListSerializer.
Looks good to me, nice work! |
This commit make the update from DRF 3.5.3 to 3.6.3 fail with:
Cause is an entry in YourSerializer that nests another serializer:
Which then fails on the SecureSerializerMixin that filters nested entries on allowed entrys for that user:
The SecureSerializerMixin fails on |
That's because you are calling |
@xordoquy my hero |
@gabn88 glad you got it working |
Sorry to revive an old issue, but then is there a recommended way to dynamically control the set of fields on a serializer instance? In 3.5.3 I was passing kwargs to my serializers' |
@kronion I don't have the time to go through the backlog but altering fields should be fine, shouldn't it ? |
Do you mean that I need to alter the fields after
|
|
Refs encode#6509 This enforces allow_empty=True when a ListSerializer is a child of another serializer and partial validation is being performed on the parent serializer. This is because partial validation should allow fields to be omitted, but should not cause values that are invalid without partial validation to become valid. This effectively reverts encode#4222. None of the tests added in that PR fail if the associated change is removed, so I‘m not sure what that PR was trying to fix.
Refs encode#6509 This enforces allow_empty=True when a ListSerializer is a child of another serializer and partial validation is being performed on the parent serializer. This is because partial validation should allow fields to be omitted, but should not cause values that are invalid without partial validation to become valid. This effectively reverts encode#4222. None of the tests added in that PR fail if the associated change is removed, so I‘m not sure what that PR was trying to fix.
…zer (#6512) Refs #6509 This enforces allow_empty=True when a ListSerializer is a child of another serializer and partial validation is being performed on the parent serializer. This is because partial validation should allow fields to be omitted, but should not cause values that are invalid without partial validation to become valid. This effectively reverts #4222. None of the tests added in that PR fail if the associated change is removed, so I‘m not sure what that PR was trying to fix.
…zer (encode#6512) Refs encode#6509 This enforces allow_empty=True when a ListSerializer is a child of another serializer and partial validation is being performed on the parent serializer. This is because partial validation should allow fields to be omitted, but should not cause values that are invalid without partial validation to become valid. This effectively reverts encode#4222. None of the tests added in that PR fail if the associated change is removed, so I‘m not sure what that PR was trying to fix.
…zer (encode#6512) Refs encode#6509 This enforces allow_empty=True when a ListSerializer is a child of another serializer and partial validation is being performed on the parent serializer. This is because partial validation should allow fields to be omitted, but should not cause values that are invalid without partial validation to become valid. This effectively reverts encode#4222. None of the tests added in that PR fail if the associated change is removed, so I‘m not sure what that PR was trying to fix.
I have two serializers:
When I make partial update for ObjectSerializer without items, I get the error: