handle lack of displayname
This commit is contained in:
parent
ebc5b4abd6
commit
d40180cd42
1 changed files with 3 additions and 3 deletions
|
@ -142,6 +142,6 @@ def get_displayname(userid):
|
|||
r = requests.get(url)
|
||||
if r.status_code == 200:
|
||||
data = json.loads(r.text)
|
||||
return data["displayname"]
|
||||
else:
|
||||
return userid
|
||||
if 'displayname' in data:
|
||||
return data["displayname"]
|
||||
return userid
|
||||
|
|
Loading…
Reference in a new issue