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

Added deprecation warning to NLBankAccountNumberField #307

Merged
merged 5 commits into from
Sep 19, 2017

Conversation

jieter
Copy link
Contributor

@jieter jieter commented Jul 28, 2017

ref #150

All Changes

  • Add an entry to the docs/changelog.rst describing the change.

  • Add an entry for your name in the docs/authors.rst file if it's not
    already there.

  • Adjust your imports to a standard form by running this command:

    `isort --recursive --line-width 120 localflavor tests`
    

@codecov-io
Copy link

codecov-io commented Jul 28, 2017

Codecov Report

Merging #307 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #307      +/-   ##
==========================================
+ Coverage   96.26%   96.26%   +<.01%     
==========================================
  Files         156      156              
  Lines        4360     4361       +1     
  Branches      588      588              
==========================================
+ Hits         4197     4198       +1     
  Misses        102      102              
  Partials       61       61
Impacted Files Coverage Δ
localflavor/nl/models.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f04d55...eb8e8b6. Read the comment docs.

Copy link
Member

@benkonrath benkonrath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. I've added some comments for some improvements.

"""

def __init__(self, *args, **kwargs):
warnings.warn("NLBankAccountNumberField is deprecated. Use `localflavor.generic.models.IBANField` "
"with included_countries=('nl') option instead.", RemovedInLocalflavor20Warning)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For deprecating the phone number models we're using the system check framework. Do you think it make sense to use the system check framework here as well?
https://github.com/django/django-localflavor/blob/master/localflavor/deprecation.py#L21-L24

Also, IBANField isn't a direct replacement for NLBankAccountNumberField. Users would need to do a data migration and generate the IBAN for each NL bank account number. My feeling is that adding this data migration is out of scope for localflavor. Calculating the check digits straightforward but we'd need to somehow map the NL account numbers to a 4 character IBAN bank ID and I don't this mapping readily available. I think we should just have a note stating that a data migration is required if users want to directly replace the NLBankAccountNumberField with the IBANFeild. Otherwise, user will need to use both fields in parallel for a while.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no preference regarding the systems check framework vs using warnings.warn. If you do prefer using the systems check framework, I'll be happy to change the patch.

You're right about the data migration, I'll add a note.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the systems check framework to keep things consistent with the other model deprecations. Thanks.

@jieter
Copy link
Contributor Author

jieter commented Sep 3, 2017

@benkonrath, holidays came in the way, I'll try to work on this coming week.

@jieter
Copy link
Contributor Author

jieter commented Sep 14, 2017

@benkonrath changed the deprecation warning and also rebased on current master.

@benkonrath
Copy link
Member

Looks good. You just need to remove the unused import.

localflavor/nl/models.py
  Line: 6
    pyflakes: F401 / 'localflavor.deprecation.RemovedInLocalflavor20Warning' imported but unused (col 1)

@benkonrath benkonrath merged commit 24a5658 into django:master Sep 19, 2017
benkonrath added a commit that referenced this pull request Nov 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants