From 249eb6f931e88e06339dbb5cdbd3e82630f20c0d Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Thu, 29 Sep 2011 19:47:20 +0200 Subject: Make sure to check for "is not None" so that depth=0 gets assigned properly. Thanks thomasst. --- djangorestframework/serializer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'djangorestframework/serializer.py') diff --git a/djangorestframework/serializer.py b/djangorestframework/serializer.py index 22efa5ed..55b84df1 100644 --- a/djangorestframework/serializer.py +++ b/djangorestframework/serializer.py @@ -106,7 +106,8 @@ class Serializer(object): def __init__(self, depth=None, stack=[], **kwargs): - self.depth = depth or self.depth + if depth is not None: + self.depth = depth self.stack = stack -- cgit v1.2.3