use a local instance of LinearDateGuesser instead of global one
When giving LinearDateGuesser instance to DateGuesser at Page's declaration, that'll be the SAME object for all the life-time of the module. So when listing transactions of a second account, the first taken date is the date of the oldest transaction of the first account!
This commit is contained in:
parent
920583eae7
commit
87070bf05a
4 changed files with 15 additions and 13 deletions
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
from weboob.browser import LoginBrowser, URL, need_login
|
||||
from weboob.exceptions import BrowserIncorrectPassword
|
||||
from weboob.tools.date import LinearDateGuesser
|
||||
|
||||
from .pages import LoginPage, LoginErrorPage, AvoirPage, OperationsTraiteesPage, OperationsFuturesPage
|
||||
|
||||
|
|
@ -50,12 +51,12 @@ class GroupamaesBrowser(LoginBrowser):
|
|||
|
||||
@need_login
|
||||
def get_history(self):
|
||||
transactions = list(self.operations_traitees.go().get_history())
|
||||
transactions = list(self.operations_traitees.go().get_history(date_guesser=LinearDateGuesser()))
|
||||
transactions.sort(key=lambda tr: tr.rdate, reverse=True)
|
||||
return transactions
|
||||
|
||||
@need_login
|
||||
def get_coming(self):
|
||||
transactions = list(self.operations_futures.go().get_list())
|
||||
transactions = list(self.operations_futures.go().get_list(date_guesser=LinearDateGuesser()))
|
||||
transactions.sort(key=lambda tr: tr.rdate, reverse=True)
|
||||
return transactions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue