Skip to content

Commit 2d5b4f4

Browse files
committed
Depth should reduce
Depth should reduce
1 parent 2e6d39d commit 2d5b4f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rest_framework/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ def build_nested_field(self, field_name, relation_info, nested_depth):
10341034
class NestedSerializer(ModelSerializer):
10351035
class Meta:
10361036
model = relation_info.related_model
1037-
depth = nested_depth
1037+
depth = nested_depth - 1
10381038

10391039
field_class = NestedSerializer
10401040
field_kwargs = get_nested_relation_kwargs(relation_info)

0 commit comments

Comments
 (0)