|
@ -45,8 +45,8 @@ class Phone(fields.Char): |
|
|
res_parse = phonenumbers.parse(res) |
|
|
res_parse = phonenumbers.parse(res) |
|
|
res = phonenumbers.format_number( |
|
|
res = phonenumbers.format_number( |
|
|
res_parse, phonenumbers.PhoneNumberFormat.INTERNATIONAL) |
|
|
res_parse, phonenumbers.PhoneNumberFormat.INTERNATIONAL) |
|
|
narrow_no_break_space = u'\u202f' |
|
|
|
|
|
res = res.replace(' ', narrow_no_break_space) |
|
|
|
|
|
|
|
|
no_break_space = u'\u00A0' |
|
|
|
|
|
res = res.replace(' ', no_break_space) |
|
|
except: |
|
|
except: |
|
|
pass |
|
|
pass |
|
|
# print 'cache value', res |
|
|
# print 'cache value', res |
|
@ -57,9 +57,6 @@ def convert_phone_field(value, country_code): |
|
|
_logger.debug( |
|
|
_logger.debug( |
|
|
'convert_phone_field value=%s country=%s', value, country_code) |
|
|
'convert_phone_field value=%s country=%s', value, country_code) |
|
|
try: |
|
|
try: |
|
|
narrow_no_break_space = u'\u202f' |
|
|
|
|
|
# phonenumbers.parse fails with narrow_no_break_space |
|
|
|
|
|
value = value.replace(narrow_no_break_space, '') |
|
|
|
|
|
res_parse = phonenumbers.parse( |
|
|
res_parse = phonenumbers.parse( |
|
|
value, country_code) |
|
|
value, country_code) |
|
|
_logger.debug('res_parse=%s', res_parse) |
|
|
_logger.debug('res_parse=%s', res_parse) |
|
|