django / django-localflavor

Country-specific Django helpers, formerly of contrib fame
https://django-localflavor.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
813 stars 289 forks source link

Update Egypt IBAN code length to 29 characters #423

Closed dotwork closed 3 years ago

dotwork commented 3 years ago

A user recently had trouble submitting a 29-character IBAN code for Egypt. It appears the IBAN code was updated from 27 to 29 characters in June 2020. Please update the validation to expect this. Thank you!

Here are a couple sources: https://dailynewsegypt.com/2020/07/04/banks-in-egypt-switch-to-iban-standard-to-ease-cross-border-transactions/#:~:text=For%20Egypt%2C%20the%20IBAN%20consists,the%20domestic%20bank%20account%20code

https://en.wikipedia.org/wiki/International_Bank_Account_Number

from localflavor.generic.models import IBANValidator iban = 'EG800002000156789012345180002' assert 29 == len(iban) validator = IBANValidator(use_nordea_extensions=True) validator(iban)