aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Christie2012-06-28 14:16:30 +0200
committerTom Christie2012-06-28 14:16:30 +0200
commit11147ce13e754f47b9cdc8d0de8a071aa540882f (patch)
tree9f8d3dd34097aef9fe4f208e7f17b90b8069e933
parentc124585df6e7cc4c4103f6118975013cfadca9e7 (diff)
downloaddjango-rest-framework-11147ce13e754f47b9cdc8d0de8a071aa540882f.tar.bz2
Don't bork if request attribute is not set.
-rw-r--r--djangorestframework/serializer.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/djangorestframework/serializer.py b/djangorestframework/serializer.py
index ffe9d8cb..027c9daf 100644
--- a/djangorestframework/serializer.py
+++ b/djangorestframework/serializer.py
@@ -180,7 +180,7 @@ class Serializer(object):
stack.append(obj)
return related_serializer(depth=depth, stack=stack).serialize(
- obj, request=self.request)
+ obj, request=getattr(self, 'request', None))
def serialize_max_depth(self, obj):
"""