Fix selecting a field in non-interactive mode

The command:
boobank ing history blabla@ing -f table -s label,amount,date
was bugued, since b770163d9b.

Before to iter the history, boobank uses the get_object method, with fields set to []. The goal is to not use the selected_fields configured by the user.

But the commit b770163d9b added:
"or self.selected_fields"
Since "if []" return false, it cannot works.
This commit is contained in:
Florent 2014-04-18 10:24:47 +02:00
commit a03f2b627e

View file

@ -351,12 +351,12 @@ class ReplApplication(Cmd, ConsoleApplication):
kwargs['backends'].append(backend)
else:
kwargs['backends'] = backends
fields = kwargs.pop('fields', self.selected_fields) or self.selected_fields
if '$direct' in fields:
fields = []
elif '$full' in fields:
fields = None
fields = kwargs.pop('fields', self.selected_fields)
if not fields and fields != []:
if '$direct' in fields:
fields = []
elif '$full' in fields:
fields = None
return self.weboob.do(self._do_complete, self.options.count, fields, function, *args, **kwargs)
# -- command tools ------------