mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Update django-phonenumber-field requirement from ==7.3.* to ==8.3.* (#5522)
* Update django-phonenumber-field requirement from ==7.3.* to ==8.3.* Updates the requirements on [django-phonenumber-field](https://github.com/stefanfoulis/django-phonenumber-field) to permit the latest version. - [Release notes](https://github.com/stefanfoulis/django-phonenumber-field/releases) - [Changelog](https://github.com/stefanfoulis/django-phonenumber-field/blob/main/CHANGELOG.rst) - [Commits](https://github.com/stefanfoulis/django-phonenumber-field/compare/7.3.0...8.3.0) --- updated-dependencies: - dependency-name: django-phonenumber-field dependency-version: 8.3.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> * Remove invalid geo codes --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Raphael Michel <michel@rami.io>
This commit is contained in:
@@ -25,7 +25,9 @@ from django.utils import translation
|
||||
from django.utils.translation import gettext_noop
|
||||
from django_countries import Countries, collator
|
||||
from django_countries.fields import CountryField
|
||||
from phonenumbers.data import _COUNTRY_CODE_TO_REGION_CODE
|
||||
from phonenumbers import (
|
||||
COUNTRY_CODE_TO_REGION_CODE, REGION_CODE_FOR_NON_GEO_ENTITY,
|
||||
)
|
||||
|
||||
from pretix.base.i18n import get_babel_locale, get_language_without_region
|
||||
|
||||
@@ -109,9 +111,11 @@ def get_phone_prefixes_sorted_and_localized():
|
||||
val = []
|
||||
|
||||
locale = Locale(translation.to_locale(language))
|
||||
for prefix, values in _COUNTRY_CODE_TO_REGION_CODE.items():
|
||||
for prefix, values in COUNTRY_CODE_TO_REGION_CODE.items():
|
||||
prefix = "+%d" % prefix
|
||||
for country_code in values:
|
||||
if country_code == REGION_CODE_FOR_NON_GEO_ENTITY:
|
||||
continue
|
||||
country_name = locale.territories.get(country_code)
|
||||
if country_name:
|
||||
val.append((prefix, "{} {}".format(country_name, prefix)))
|
||||
|
||||
Reference in New Issue
Block a user