aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/fields.py
diff options
context:
space:
mode:
authorTom Christie2013-05-18 04:36:00 -0700
committerTom Christie2013-05-18 04:36:00 -0700
commit6d425aa3be8e94f022af742c2304b6831efcf8c9 (patch)
treeda1816ad479ce8d73a129388cba8e23c61f0850b /rest_framework/fields.py
parent0c95405ea7d9d93c2f03add3ec8c10afad08b63a (diff)
parent24c9c455feaa47487196a2c9343746d7d5bdd962 (diff)
downloaddjango-rest-framework-6d425aa3be8e94f022af742c2304b6831efcf8c9.tar.bz2
Merge pull request #831 from brianz/master
Allow nested fields to be missing
Diffstat (limited to 'rest_framework/fields.py')
-rw-r--r--rest_framework/fields.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/rest_framework/fields.py b/rest_framework/fields.py
index 9bbe6633..491aa7ed 100644
--- a/rest_framework/fields.py
+++ b/rest_framework/fields.py
@@ -52,7 +52,7 @@ def get_component(obj, attr_name):
return that attribute on the object.
"""
if isinstance(obj, dict):
- val = obj[attr_name]
+ val = obj.get(attr_name)
else:
val = getattr(obj, attr_name)