From 8ace5e125fa2e7c907b3d93a28dfed2da1ca4d19 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 13 May 2015 11:05:25 +0200 Subject: [PATCH] FIX a crash when exception has no len --- base_phone/wizard/reformat_all_phonenumbers.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/base_phone/wizard/reformat_all_phonenumbers.py b/base_phone/wizard/reformat_all_phonenumbers.py index ad64372..252ab1d 100644 --- a/base_phone/wizard/reformat_all_phonenumbers.py +++ b/base_phone/wizard/reformat_all_phonenumbers.py @@ -70,13 +70,12 @@ class reformat_all_phonenumbers(models.TransientModel): except Exception, e: name = obj.name_get( cr, uid, [init_entry['id']], context=context)[0][1] - err_msg = e and len(e) > 1 and e[1] or 'missing error msg' phonenumbers_not_reformatted += \ "Problem on %s '%s'. Error message: %s\n" % ( - obj._description, name, err_msg) + obj._description, name, unicode(e)) logger.warning( "Problem on %s '%s'. Error message: %s" % ( - obj._description, name, err_msg)) + obj._description, name, unicode(e))) continue if any( [init_entry.get(field)