Fix history for saving accounts

This commit is contained in:
Florent 2014-09-02 15:23:32 +02:00
commit 4c29f8a4cd
2 changed files with 10 additions and 2 deletions

View file

@ -129,9 +129,13 @@ class IngBrowser(LoginBrowser):
self.logger.info('There is no history for this account')
return
if account.type == Account.TYPE_CHECKING:
history_function = self.page.get_transactions_cc
else:
history_function = self.page.get_transactions_others
hashlist = []
while True:
for transaction in self.page.get_transactions():
for transaction in history_function():
transaction.id = hashlib.md5(transaction._hash).hexdigest()
while transaction.id in hashlist:
transaction.id = hashlib.md5(transaction.id + "1").hexdigest()

View file

@ -156,9 +156,13 @@ class AccountsList(LoggedPage, HTMLPage):
item_xpath = '//div[@class="transactions cc future"]//table'
@method
class get_transactions(generic_transactions):
class get_transactions_cc(generic_transactions):
item_xpath = '//div[@class="temporaryTransactionList"]//table'
@method
class get_transactions_others(generic_transactions):
item_xpath = '//table'
def get_history_jid(self):
span = self.doc.xpath('//span[@id="index:panelASV"]')
if len(span) > 1: