credativ team mailing list archive
-
credativ team
-
Mailing list archive
-
Message #00056
[Merge] lp:~credativ/account-banking/fix-read-method into lp:~credativ/account-banking/upgrade-6.0
Dmitrijs Ledkovs (credativ) has proposed merging lp:~credativ/account-banking/fix-read-method into lp:~credativ/account-banking/upgrade-6.0.
Requested reviews:
Credativ (credativ)
For more details, see:
https://code.launchpad.net/~credativ/account-banking/fix-read-method/+merge/80796
[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
--
https://code.launchpad.net/~credativ/account-banking/fix-read-method/+merge/80796
Your team Credativ is requested to review the proposed merge of lp:~credativ/account-banking/fix-read-method into lp:~credativ/account-banking/upgrade-6.0.
=== modified file 'account_banking/account_banking.py'
--- account_banking/account_banking.py 2011-07-21 11:30:59 +0000
+++ account_banking/account_banking.py 2011-10-31 12:02:09 +0000
@@ -1098,6 +1098,8 @@
Convert IBAN electronic format to IBAN display format
'''
records = self._founder.read(self, *args, **kwargs)
+ if not isinstance(records, list):
+ records = [records,]
for record in records:
if 'iban' in record and record['iban']:
record['iban'] = unicode(sepa.IBAN(record['iban']))
Follow ups