From da06fb15b4d92a381c5905c12ac976875d9dab30 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 27 Jun 2016 23:52:05 +0200 Subject: [PATCH] FIX write when input has no_break_space --- base_phone/fields.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/base_phone/fields.py b/base_phone/fields.py index 495c358..4908a69 100644 --- a/base_phone/fields.py +++ b/base_phone/fields.py @@ -57,6 +57,9 @@ 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)