Skip to content

Commit 6197ef9

Browse files
author
Tim Csitkovics
committed
fixup! Do not lazy load forward relations
1 parent 42b3f57 commit 6197ef9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

rest_framework_json_api/serializers.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,7 @@ def to_representation(self, instance):
184184
try:
185185
context = getattr(self, '_context', {})
186186
request = getattr(context.get('request', None), '_request', None)
187-
get_dict = getattr(request, 'GET', None) if request is not None else {}
188-
includes = get_dict['include'].split(',') if 'include' in get_dict else []
189-
is_included = field.source in includes
187+
is_included = field.source in get_included_resources(request)
190188
if not is_included \
191189
and isinstance(field, ModelSerializer) \
192190
and hasattr(instance, field.source + "_id"):

0 commit comments

Comments
 (0)