ERepublik: Fix fetch of citizen when given by name.

master
Valentin Lorentz 2013-05-22 21:29:23 +02:00
parent 60348b3d83
commit 77cbf1e5b3
1 changed files with 2 additions and 1 deletions

View File

@ -54,8 +54,9 @@ def getCitizen(irc, name):
else:
base = 'http://api.erpk.org/citizen/search/%s/1.json?key=nIKh0F7U'
data = json.load(utils.web.getUrlFd(base % name))
return getCitizen(irc, data[0]['id'])
return getCitizen(irc, str(data[0]['id']))
except:
raise
irc.error(_('This citizen does not exist.'), Raise=True)
def flatten_subdicts(dicts):