mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +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:
@@ -66,8 +66,10 @@ from geoip2.errors import AddressNotFoundError
|
||||
from phonenumber_field.formfields import PhoneNumberField
|
||||
from phonenumber_field.phonenumber import PhoneNumber
|
||||
from phonenumber_field.widgets import PhoneNumberPrefixWidget
|
||||
from phonenumbers import NumberParseException, national_significant_number
|
||||
from phonenumbers.data import _COUNTRY_CODE_TO_REGION_CODE
|
||||
from phonenumbers import (
|
||||
COUNTRY_CODE_TO_REGION_CODE, REGION_CODE_FOR_NON_GEO_ENTITY,
|
||||
NumberParseException, national_significant_number,
|
||||
)
|
||||
from PIL import ImageOps
|
||||
|
||||
from pretix.base.forms.widgets import (
|
||||
@@ -305,7 +307,9 @@ class WrappedPhonePrefixSelect(Select):
|
||||
choices = [("", "---------")]
|
||||
|
||||
if initial:
|
||||
for prefix, values in _COUNTRY_CODE_TO_REGION_CODE.items():
|
||||
for prefix, values in COUNTRY_CODE_TO_REGION_CODE.items():
|
||||
if all(v == REGION_CODE_FOR_NON_GEO_ENTITY for v in values):
|
||||
continue
|
||||
if initial in values:
|
||||
self.initial = "+%d" % prefix
|
||||
break
|
||||
@@ -437,7 +441,9 @@ def guess_phone_prefix_from_request(request, event):
|
||||
|
||||
|
||||
def get_phone_prefix(country):
|
||||
for prefix, values in _COUNTRY_CODE_TO_REGION_CODE.items():
|
||||
if country == REGION_CODE_FOR_NON_GEO_ENTITY:
|
||||
return None
|
||||
for prefix, values in COUNTRY_CODE_TO_REGION_CODE.items():
|
||||
if country in values:
|
||||
return prefix
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user