From 96181bad0ca933702f0aa2f776ae2dc312041fee Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Tue, 11 Dec 2012 16:06:46 +0100 Subject: [PATCH] ugly workaround to prevent duplicated accounts --- modules/lcl/pages.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/lcl/pages.py b/modules/lcl/pages.py index ae505293..1acc8c7d 100644 --- a/modules/lcl/pages.py +++ b/modules/lcl/pages.py @@ -143,6 +143,7 @@ class ContractsPage(BasePage): class AccountsPage(BasePage): def get_list(self): l = [] + ids = set() for a in self.document.getiterator('a'): link=a.attrib.get('href') if link is None: @@ -164,6 +165,11 @@ class AccountsPage(BasePage): # TODO parse this string to get the right Account.TYPE_* to # store in account.type. account._type=value + + if account.id in ids: + continue + + ids.add(account.id) div = a.getparent().getprevious() if not div.text.strip(): div = div.find('div')