aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rest_framework/serializers.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py
index ed709d84..6f89df0d 100644
--- a/rest_framework/serializers.py
+++ b/rest_framework/serializers.py
@@ -1112,7 +1112,7 @@ class ModelSerializer(Serializer):
class NestedSerializer(ModelSerializer):
class Meta:
model = relation_info.related
- depth = nested_depth
+ depth = nested_depth - 1
return NestedSerializer
@@ -1139,6 +1139,6 @@ class HyperlinkedModelSerializer(ModelSerializer):
class NestedSerializer(HyperlinkedModelSerializer):
class Meta:
model = relation_info.related
- depth = nested_depth
+ depth = nested_depth - 1
return NestedSerializer