Commit 1e336ef3 by Tom Christie

Move comment

parent 9d3810f3
......@@ -89,8 +89,8 @@ class RelatedField(Field):
def get_attribute(self, instance):
if self.use_pk_only_optimization() and self.source_attrs:
# Optimized case, return a mock object only containing the pk attribute.
try:
# Optimized case, return a mock object only containing the pk attribute.
instance = get_attribute(instance, self.source_attrs[:-1])
return PKOnlyObject(pk=instance.serializable_value(self.source_attrs[-1]))
except AttributeError:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment