openwisp / openwisp-users

Implementation of user management and multi-tenancy for OpenWISP
https://openwisp.io/docs/dev/users/
BSD 3-Clause "New" or "Revised" License
163 stars 74 forks source link

[deps] Update django-phonenumber-field requirement from ~=6.1.0 to ~=8.0.0 #400

Closed dependabot[bot] closed 3 months ago

dependabot[bot] commented 3 months ago

Updates the requirements on django-phonenumber-field to permit the latest version.

Release notes

Sourced from django-phonenumber-field's releases.

8.0.0

What's Changed

Breaking changes

Other changes

Full Changelog: https://github.com/stefanfoulis/django-phonenumber-field/compare/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:

Changelog

Sourced from django-phonenumber-field's changelog.

CHANGELOG

Note: Releases are now tracked using GitHub releases <https://github.com/stefanfoulis/django-phonenumber-field/releases>__. This document remains for historical purposes.

6.1.0 (2022-01-12)

  • Make formfields.PhoneNumberField honor PHONENUMBER_DEFAULT_REGION
  • Use PHONENUMBER_DEFAULT_REGION for example phone number in form field errors.
  • Add support for Django 4.0
  • Add Persian (farsi) translations.
  • Update uk_AR translations

Backwards incompatible changes

  • Drop support for Python 3.6

6.0.0 (2021-10-20)

  • Add support for Python 3.10
  • Update Czech, Dutch and pt_BR translations

Backwards incompatible changes

  • formfields.PhoneNumberField with a region now display national phone numbers in the national format instead of PHONENUMBER_DEFAULT_FORMAT. International numbers are displayed in the PHONENUMBER_DEFAULT_FORMAT.

5.2.0 (2021-05-31)

  • Lazy load formfields.PhoneNumberField translation for invalid data.
  • Update Russian translations

Backwards incompatible changes

  • Drop support for end-of-life Django 3.0

5.1.0 (2021-04-02)

  • Allow sorting PhoneNumber\ s from Python
  • Add support for Python 3.9 and Django 3.2
  • Add Argentinian, Bulgarian, Indonesian, Ukrainian translations
  • Update Esperanto and European Spanish translations

... (truncated)

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
  • 4484533 update Italian locale
  • ee1dd71 Make PhoneNumberPrefixSelect use the provided region
  • cb83645 Merge pull request #590 from francoisfreitag/mo
  • b1f355d Merge pull request #591 from stefanfoulis/dependabot/github_actions/actions/u...
  • Additional commits viewable in compare view


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 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)
coveralls commented 3 months ago

Coverage Status

coverage: 97.784%. remained the same when pulling f31d9dcbefb182e8c142f7c9a9f7baec80499371 on dependabot/pip/django-phonenumber-field-approx-eq-8.0.0 into 9f60905ce7dd8104df4dd1246c5d2be5ed8c7d15 on master.