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

⬆(deps): Bump django-phonenumber-field[phonenumbers] from 7.3.0 to 8.0.0 #734

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jun 24, 2024

Bumps django-phonenumber-field[phonenumbers] from 7.3.0 to 8.0.0.

Release notes

Sourced from django-phonenumber-field[phonenumbers]'s releases.

8.0.0

What's Changed

Breaking changes

Other changes

Full Changelog: stefanfoulis/django-phonenumber-field@7.3.0...8.0.0


Migration guide

Previously, the widgets handled part of the validation. That behavior prevents overriding validation in form fields, as widgets were casting the value into a PhoneNumber object, validating it in the process.

Following the MultiValueField implementation from Django (and MultiWidget), the widget now handles the presentation logic, but makes no attempt at validation. The new SplitPhoneNumberField handles the logic of validating the region choice and the number, and the PhoneNumberPrefixWidget simply dispatches the region and number data to the appropriate widget.

In order to retain backward compatibility, now that the validate_international_phonenumber actually comes into play, its error code has been changed to invalid, so that the custom error message for invalid shows.

validate_international_phonenumber

Review uses of the invalid_phone_number error code. You’ll probably want to replace them with invalid. Given that the validator usually did not come into play, you shouldn’t find many uses.

PhoneNumberField with RegionalPhoneNumberWidget

Move the custom validation occurs in the Django Form clean_FIELD() (or clean()), and no changes should be noticeable.

PhoneNumberField with PhoneNumberPrefixWidget

Use the SplitPhoneNumberField instead. Error messages will change slightly and should be more precise (whether the region is not part of the choices, or the number cannot be interpreted in the selected region).

For more examples, take a look at tests.test_formfields.SplitPhoneNumberFieldTest. Make sure GitHub loads the diff for file tests/test_formfields.py

The following tests should cover most use cases:

Commits
  • f7765f4 docs: Fix representation of serializer
  • b255326 Add validate_phonenumber to allow short numbers
  • b8d1886 Rename test_value_from_datadict to test_example_numbers
  • 9923578 Move validation from widgets to the form fields
  • e491d09 Drop support for Django 4.1
  • ef1e728 Remove PhoneNumberInternationalFallbackWidget
  • See full diff in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [django-phonenumber-field[phonenumbers]](https://github.com/stefanfoulis/django-phonenumber-field) from 7.3.0 to 8.0.0.
- [Release notes](https://github.com/stefanfoulis/django-phonenumber-field/releases)
- [Changelog](https://github.com/stefanfoulis/django-phonenumber-field/blob/main/CHANGELOG.rst)
- [Commits](stefanfoulis/django-phonenumber-field@7.3.0...8.0.0)

---
updated-dependencies:
- dependency-name: django-phonenumber-field[phonenumbers]
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file python Pull requests that update Python code labels Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file python Pull requests that update Python code
Projects
Status: Ready for Review
Development

Successfully merging this pull request may close these issues.

0 participants