diff --git a/rest_framework_json_api/utils.py b/rest_framework_json_api/utils.py index 57d978aa..47b40217 100644 --- a/rest_framework_json_api/utils.py +++ b/rest_framework_json_api/utils.py @@ -261,7 +261,8 @@ def extract_relationships(fields, resource, resource_instance): continue try: - relation_instance_or_manager = getattr(resource_instance, field_name) + source = field.source + relation_instance_or_manager = getattr(resource_instance, source) except AttributeError: # Skip fields defined on the serializer that don't correspond to a field on the model continue