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 093b0eb5..1f76c4c1 100644
--- a/rest_framework/serializers.py
+++ b/rest_framework/serializers.py
@@ -1216,7 +1216,7 @@ class ModelSerializer(Serializer):
class NestedSerializer(ModelSerializer):
class Meta:
model = relation_info.related
- depth = nested_depth
+ depth = nested_depth - 1
return NestedSerializer
@@ -1247,6 +1247,6 @@ class HyperlinkedModelSerializer(ModelSerializer):
class NestedSerializer(HyperlinkedModelSerializer):
class Meta:
model = relation_info.related
- depth = nested_depth
+ depth = nested_depth - 1
return NestedSerializer