Merge lp:~credativ/account-banking/fix-read-method into lp:account-banking

Proposed by Dimitri John Ledkov (ex-credativ)
Status: Needs review
Proposed branch: lp:~credativ/account-banking/fix-read-method
Merge into: lp:account-banking
Diff against target: 12 lines (+2/-0)
1 file modified
account_banking/account_banking.py (+2/-0)
To merge this branch: bzr merge lp:~credativ/account-banking/fix-read-method
Reviewer Review Type Date Requested Status
Pieter J. Kersten (EduSense BV) Pending
Review via email: mp+80792@code.launchpad.net

Description of the change

  [FIX] iban read method to accept a single item or a list

  web-client sometimes passes a list of ids, or just a single id.
  In the latter case a single record is returned, instead of a list of records.
  Adjust code to cope with that situation.

To post a comment you must log in.

Unmerged revisions

63. By Dimitri John Ledkov

[FIX] iban read method to accept a single item or a list

web-client sometimes passes a list of ids, or just a single id.
In the latter case a single record is returned, instead of a list of records.
Adjust code to cope with that situation.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_banking/account_banking.py'
2--- account_banking/account_banking.py 2011-04-27 11:42:52 +0000
3+++ account_banking/account_banking.py 2011-10-31 11:59:23 +0000
4@@ -1118,6 +1118,8 @@
5 Convert IBAN electronic format to IBAN display format
6 '''
7 records = self._founder.read(self, *args, **kwargs)
8+ if not isinstance(records, list):
9+ records = [records,]
10 for record in records:
11 if 'iban' in record and record['iban']:
12 record['iban'] = unicode(sepa.IBAN(record['iban']))

Subscribers

People subscribed via source and target branches