-
Notifications
You must be signed in to change notification settings - Fork 295
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
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
There was a problem hiding this 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.
localflavor/nl/models.py
Outdated
""" | ||
|
||
def __init__(self, *args, **kwargs): | ||
warnings.warn("NLBankAccountNumberField is deprecated. Use `localflavor.generic.models.IBANField` " | ||
"with included_countries=('nl') option instead.", RemovedInLocalflavor20Warning) | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@benkonrath, holidays came in the way, I'll try to work on this coming week. |
8234cc1
to
83a93d0
Compare
@benkonrath changed the deprecation warning and also rebased on current master. |
Looks good. You just need to remove the unused import.
|
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: