forked from CGM_Public/pretix_original
Fix phone number parsing of initial values
This commit is contained in:
@@ -318,7 +318,12 @@ class WrappedPhoneNumberPrefixWidget(PhoneNumberPrefixWidget):
|
|||||||
silently deleting data.
|
silently deleting data.
|
||||||
"""
|
"""
|
||||||
if value:
|
if value:
|
||||||
if type(value) == PhoneNumber:
|
if isinstance(value, str):
|
||||||
|
try:
|
||||||
|
value = PhoneNumber.from_string(value)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
if isinstance(value, PhoneNumber):
|
||||||
if value.country_code and value.national_number:
|
if value.country_code and value.national_number:
|
||||||
return [
|
return [
|
||||||
"+%d" % value.country_code,
|
"+%d" % value.country_code,
|
||||||
|
|||||||
Reference in New Issue
Block a user