Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ae759e5

Browse files
committed
Fix polymorphic type resolution in relations
1 parent ca23885 commit ae759e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rest_framework_json_api/relations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def to_representation(self, value):
169169
pk = value.pk
170170

171171
resource_type = self.get_resource_type_from_included_serializer()
172-
if resource_type is None and self._skip_polymorphic_optimization:
172+
if resource_type is None or not self._skip_polymorphic_optimization:
173173
resource_type = get_resource_type_from_instance(value)
174174

175175
return OrderedDict([('type', resource_type), ('id', str(pk))])

0 commit comments

Comments
 (0)