mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
Remove None handling from fields.get_attribute()
This commit is contained in:
parent
94e5d05caa
commit
07258ca032
|
@ -93,9 +93,6 @@ def get_attribute(instance, attrs):
|
|||
Also accepts either attribute lookup on objects or dictionary lookups.
|
||||
"""
|
||||
for attr in attrs:
|
||||
if instance is None:
|
||||
# Break out early if we get `None` at any point in a nested lookup.
|
||||
return None
|
||||
try:
|
||||
if isinstance(instance, collections.Mapping):
|
||||
instance = instance[attr]
|
||||
|
|
Loading…
Reference in New Issue
Block a user