|
|
@ -45,8 +45,8 @@ class Phone(fields.Char): |
|
|
|
res_parse = phonenumbers.parse(res) |
|
|
|
res = phonenumbers.format_number( |
|
|
|
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: |
|
|
|
pass |
|
|
|
# print 'cache value', res |
|
|
@ -57,9 +57,6 @@ def convert_phone_field(value, country_code): |
|
|
|
_logger.debug( |
|
|
|
'convert_phone_field value=%s country=%s', value, country_code) |
|
|
|
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( |
|
|
|
value, country_code) |
|
|
|
_logger.debug('res_parse=%s', res_parse) |
|
|
|