mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 08:24:47 +00:00
fix: handled value Error (#18361)
This commit is contained in:
committed by
Nabin Hait
parent
98a9a4865e
commit
0e23307dbf
@@ -48,7 +48,10 @@ class BankAccount(Document):
|
|||||||
# Encode characters as numbers
|
# Encode characters as numbers
|
||||||
encoded = [encode_char(c) if ord(c) >= 65 and ord(c) <= 90 else c for c in flipped]
|
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:
|
if to_check % 97 != 1:
|
||||||
frappe.throw(_('IBAN is not valid'))
|
frappe.throw(_('IBAN is not valid'))
|
||||||
|
|||||||
Reference in New Issue
Block a user