fix: handled value Error (#18361)
This commit is contained in:
parent
98a9a4865e
commit
0e23307dbf
@ -48,7 +48,10 @@ class BankAccount(Document):
|
||||
# Encode characters as numbers
|
||||
encoded = [encode_char(c) if ord(c) >= 65 and ord(c) <= 90 else c for c in flipped]
|
||||
|
||||
to_check = int(''.join(encoded))
|
||||
try:
|
||||
to_check = int(''.join(encoded))
|
||||
except ValueError:
|
||||
frappe.throw(_('IBAN is not valid'))
|
||||
|
||||
if to_check % 97 != 1:
|
||||
frappe.throw(_('IBAN is not valid'))
|
||||
|
Loading…
x
Reference in New Issue
Block a user