Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBANField with Nordea extensions does not validate #202

Closed
synotna opened this issue Mar 7, 2016 · 5 comments
Closed

IBANField with Nordea extensions does not validate #202

synotna opened this issue Mar 7, 2016 · 5 comments
Assignees
Labels

Comments

@synotna
Copy link

synotna commented Mar 7, 2016

Using an IBANField with Nordea extensions enabled does not validate when trying to use a Nordea IBAN e.g. from Ukraine, UA573543470006762462054925026

Tested wtih:

Django 1.9.4
django-localflavor 1.2

models.py

from django.db import models

from localflavor.generic.models import IBANField


class Partner(models.Model):
    iban = IBANField(use_nordea_extensions=True)

admin.py

from django.contrib import admin

from .models import Partner


@admin.register(Partner)
class PartnerAdmin(admin.ModelAdmin):
    pass

ibanfield

@synotna
Copy link
Author

synotna commented Mar 7, 2016

I tried to debug myself but got lost in django internals; as far as I can tell, the extended validator is somehow forgotten when the ModelForm is instantiated around get_form/modelform_factory

@benkonrath
Copy link
Member

Thanks for the bug report. I'll try to look into this in the next day or two.

@benkonrath benkonrath self-assigned this Mar 9, 2016
@benkonrath benkonrath added the bug label Mar 9, 2016
@benkonrath
Copy link
Member

@synotna My time is a bit limited today but I can spend a few minutes on this.

One quick fix for supporting the Ukraine IBAN is to use the latest version of localflavor from master. The Ukraine IBAN is now officially part of the IBAN standard and I recently updated the official IBAN dictionary which means you don't have to use Nordea extensions option to validate Ukraine IBANs. Of course this is still a bug and I'd like to fix it but at least there's a way around the problem for you.

@benkonrath
Copy link
Member

I have a failing test case for this. I'll pick this up during the DjangoCon EU sprints 2 / 3 April. Thanks again for reporting this problem.

@synotna
Copy link
Author

synotna commented Mar 12, 2016

Awesome, thank you & good luck at the con, looking forward to the talks coming out of it!

vladimirnani added a commit to vladimirnani/django-localflavor that referenced this issue Apr 3, 2016
vladimirnani added a commit to vladimirnani/django-localflavor that referenced this issue Apr 3, 2016
vladimirnani added a commit to vladimirnani/django-localflavor that referenced this issue Apr 3, 2016
vladimirnani added a commit to vladimirnani/django-localflavor that referenced this issue Apr 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants