decode error message
This commit is contained in:
parent
054fda2cc0
commit
2f586980ec
1 changed files with 2 additions and 1 deletions
|
|
@ -56,7 +56,8 @@ class GeolocIpBackend(BaseBackend, ICapGeolocIp):
|
||||||
tab[key] = value
|
tab[key] = value
|
||||||
|
|
||||||
if 'erreur' in tab and tab['erreur'][0] == '1':
|
if 'erreur' in tab and tab['erreur'][0] == '1':
|
||||||
raise Exception(tab['erreur'][1:].replace('<p>', '').replace('<br />', '\n'))
|
raise Exception(tab['erreur'][1:].replace('<p>', '').replace('</p>', '').replace('<br />', '\n')\
|
||||||
|
.strip().decode('iso-8859-1'))
|
||||||
|
|
||||||
iploc = IpLocation(ipaddr)
|
iploc = IpLocation(ipaddr)
|
||||||
iploc.city = tab['ville'].decode('iso-8859-15')
|
iploc.city = tab['ville'].decode('iso-8859-15')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue