mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[FIX] Typo in postcode handling
This commit is contained in:
@@ -46,9 +46,7 @@ class PostalCode(object):
|
||||
'''
|
||||
# Sort formats on length, longest first
|
||||
formats = [(len(x), x) for x in format.split('|')]
|
||||
formats.sort()
|
||||
formats.reverse()
|
||||
formats = [x[1] for x in formats]
|
||||
formats = [x[1] for x in sorted(formats, lambda x,y: -cmp(x,y))]
|
||||
self.res = [re.compile(x.replace('#', '\\d').replace('@','[A-Z]'))
|
||||
for x in formats
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user