do not cry if an object in not support to be filled by a backend
This commit is contained in:
parent
9d693bd982
commit
8550c17cf7
4 changed files with 15 additions and 39 deletions
|
|
@ -30,7 +30,6 @@ from weboob.capabilities.base import NotAvailable, NotLoaded, ConversionWarning
|
|||
from weboob.core import Weboob, CallErrors
|
||||
from weboob.core.backendscfg import BackendsConfig
|
||||
from weboob.tools.config.iconfig import ConfigError
|
||||
from weboob.tools.backend import ObjectNotAvailable
|
||||
from weboob.tools.log import createColoredFormatter, getLogger
|
||||
from weboob.tools.misc import to_unicode
|
||||
|
||||
|
|
@ -236,13 +235,7 @@ class BaseApplication(object):
|
|||
|
||||
def _do_complete_obj(self, backend, fields, obj):
|
||||
if fields is None or len(fields) > 0:
|
||||
try:
|
||||
backend.fillobj(obj, fields)
|
||||
except ObjectNotAvailable, e:
|
||||
logging.warning(u'Could not retrieve required fields (%s): %s' % (','.join(fields), e))
|
||||
for field in fields:
|
||||
if getattr(obj, field) is NotLoaded:
|
||||
setattr(obj, field, NotAvailable)
|
||||
backend.fillobj(obj, fields)
|
||||
return obj
|
||||
|
||||
def _do_complete_iter(self, backend, count, fields, res):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue