We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c869f34 commit 484adc2Copy full SHA for 484adc2
rest_framework_json_api/relations.py
@@ -145,7 +145,7 @@ def to_representation(self, value):
145
# check to see if this resource has a different resource_name when
146
# included and use that name
147
resource_type = None
148
- root = getattr(self.parent, 'parent', self.parent)
+ root = getattr(self.parent, 'parent', self.parent) or self.parent
149
field_name = self.field_name if self.field_name else self.parent.field_name
150
if getattr(root, 'included_serializers', None) is not None:
151
includes = get_included_serializers(root)
0 commit comments