Do not try to fill None

Use case: videoob play on an unknown URL.
The get_object(... , ['url']) would throw a FieldNotFound, when the
right error should be video not found.
This commit is contained in:
Laurent Bachelier 2013-03-30 01:04:37 +01:00
commit edf72dfb33

View file

@ -354,6 +354,8 @@ class BaseBackend(object):
:param fields: what fields to fill; if None, all fields are filled
:type fields: :class:`list`
"""
if obj is None:
return obj
def not_loaded(v):
return (v is NotLoaded or isinstance(v, CapBaseObject) and not v.__iscomplete__())