Browse Source

Do not interpolate directly in logger

pull/69/head
Guewen Baconnier 9 years ago
parent
commit
00e41d9655
  1. 10
      base_phone/base_phone.py

10
base_phone/base_phone.py

@ -78,9 +78,9 @@ class PhoneCommon(models.AbstractModel):
countrycode = user.company_id.country_id.code countrycode = user.company_id.country_id.code
else: else:
_logger.warning( _logger.warning(
_("You should set a country on the company '%s' "
"to allow the reformat of phone numbers")
% user.company_id.name)
"You should set a country on the company '%s' "
"to allow the reformat of phone numbers",
user.company_id.name)
countrycode = None countrycode = None
# with country code = None, phonenumbers.parse() will work # with country code = None, phonenumbers.parse() will work
# with phonenumbers formatted in E164, but will fail with # with phonenumbers formatted in E164, but will fail with
@ -95,8 +95,8 @@ class PhoneCommon(models.AbstractModel):
res_parse, phonenumbers.PhoneNumberFormat.E164) res_parse, phonenumbers.PhoneNumberFormat.E164)
if init_value != vals[field]: if init_value != vals[field]:
_logger.debug( _logger.debug(
"%s initial value: '%s' updated value: '%s'"
% (field, init_value, vals[field]))
"%s initial value: '%s' updated value: '%s'",
field, init_value, vals[field])
except Exception, e: except Exception, e:
# I do BOTH logger and raise, because: # I do BOTH logger and raise, because:
# raise is usefull when the record is created/written # raise is usefull when the record is created/written

Loading…
Cancel
Save