Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 64f8a6b

Browse files
committedSep 16, 2015
Fix for issue #77
1 parent 4aa6c5b commit 64f8a6b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎rest_framework_json_api/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ def get_related_resource_type(relation):
174174
parent_model_relation = getattr(parent_model, parent_serializer.field_name)
175175

176176
if hasattr(parent_model_relation, 'related'):
177-
relation_model = parent_model_relation.related.model
177+
relation_model = parent_model_relation.related.related_model
178178
elif hasattr(parent_model_relation, 'field'):
179-
relation_model = parent_model_relation.field.related.model
179+
relation_model = parent_model_relation.field.related_model
180180
else:
181181
raise APIException('Unable to find related model for relation {relation}'.format(relation=relation))
182182
return format_relation_name(relation_model.__name__)

0 commit comments

Comments
 (0)
Please sign in to comment.