From 11f18a755cc5fb2a2600c8ef9620a26f84926aa9 Mon Sep 17 00:00:00 2001 From: Nicolas Selva Date: Wed, 3 Aug 2022 12:06:29 +0200 Subject: [PATCH] [TELE-1302]delete is_valid_iban --- .../templatetags/imio_teleservices.py | 33 ------------------- 1 file changed, 33 deletions(-) diff --git a/imio_teleservices_templatetags/templatetags/imio_teleservices.py b/imio_teleservices_templatetags/templatetags/imio_teleservices.py index 7d72021..0fb3c20 100644 --- a/imio_teleservices_templatetags/templatetags/imio_teleservices.py +++ b/imio_teleservices_templatetags/templatetags/imio_teleservices.py @@ -99,39 +99,6 @@ def is_valid_tva_number(tva_number, formatage=True): return False -@register.filter -def is_valid_iban(iban, formatage=True): - """ - iban : (str) iban - formatage : (bool) True/False - return : (bool) True si le numéro est valide - """ - iban_validation_modulo = 97 - iban = iban.upper() - if formatage: - iban = clean_string(iban) - if len(iban) < 5: - return False - modified_iban = iban[4: len(iban)] + iban[0:4] - numeric_iban_string = "" - for c in modified_iban: - current_char_code = ord(c) - # Integer - if (current_char_code > 47) and (current_char_code < 58): - numeric_iban_string = numeric_iban_string + c - # Char - elif (current_char_code > 64) and (current_char_code < 91): - value = current_char_code - 65 + 10 - numeric_iban_string = numeric_iban_string + str(value) - else: - return False - previous_modulo = 0 - for i in range(0, len(numeric_iban_string), 5): - subpart = str(previous_modulo) + "" + numeric_iban_string[i: i + 5] - previous_modulo = int(subpart) % iban_validation_modulo - return previous_modulo == 1 - - @register.filter def liste_type_rdv_plusieurs_personnes(value): """