From a09b941d2e18a03a0ce4bca58de85ff42868e5cb Mon Sep 17 00:00:00 2001 From: Vincent Paredes Date: Tue, 4 Nov 2014 18:55:46 +0100 Subject: [PATCH] fixing primary account display twice --- modules/paypal/pages.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/paypal/pages.py b/modules/paypal/pages.py index 1cd59d10..42e9a368 100644 --- a/modules/paypal/pages.py +++ b/modules/paypal/pages.py @@ -56,8 +56,6 @@ class AccountPage(Page): # Primary currency account primary_account = Account() primary_account.type = Account.TYPE_CHECKING - primary_account.id = unicode(primary_account.currency) - accounts[primary_account.id] = primary_account # Total currency balance. # If there are multiple currencies, this balance is all currencies @@ -69,10 +67,12 @@ class AccountPage(Page): balance = balance[0].text_content().strip() primary_account.balance = AmTr.decimal_amount(balance) primary_account.currency = Account.get_currency(balance) + primary_account.id = unicode(primary_account.currency) primary_account.label = u'%s %s*' % (self.browser.username, balance.split()[-1]) except IndexError: primary_account.balance = NotAvailable primary_account.label = u'%s' % (self.browser.username) + accounts[primary_account.id] = primary_account # The following code will only work if the user enabled multiple currencies. balance = content.xpath('.//div[@class="body"]//ul/li[@class="balance"]/span')