Skip to content

Allow partial update with polymorphic serializers #655

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

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Pass partial arg to subclass in polymorphic to_internal_value
  • Loading branch information
Charles Allatson authored and sliverc committed Jun 7, 2019
commit 1284d7a90842e11edd0840dc31c44983732b4b0c
3 changes: 2 additions & 1 deletion rest_framework_json_api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,4 +353,5 @@ def to_internal_value(self, data):
expected_types=', '.join(expected_types), received_type=received_type))
serializer_class = self.get_polymorphic_serializer_for_type(received_type)
self.__class__ = serializer_class
return serializer_class(data, context=self.context).to_internal_value(data)
return serializer_class(data, context=self.context,
partial=self.partial).to_internal_value(data)