Skip to content

Commit

Permalink
Don't bork if request attribute is not set.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchristie committed Jun 28, 2012
1 parent c124585 commit 11147ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion djangorestframework/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def serialize_val(self, key, obj, related_info):
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):
"""
Expand Down

0 comments on commit 11147ce

Please sign in to comment.