Browse Source

FIX write when input has no_break_space

pull/88/head
Alexis de Lattre 9 years ago
parent
commit
da06fb15b4
  1. 3
      base_phone/fields.py

3
base_phone/fields.py

@ -57,6 +57,9 @@ 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)

Loading…
Cancel
Save