Fix empty names
Specifically, botsin.space (for sure) returns a display name of `""`. Since that's not meaningful, I just added a check to replace the display name with the username if the display name is empty.
This commit is contained in:
parent
3f916fc558
commit
42b632eff3
1 changed files with 2 additions and 0 deletions
|
@ -18,6 +18,8 @@ class Actor(object):
|
||||||
response = response.json()
|
response = response.json()
|
||||||
self.username = response["preferredUsername"]
|
self.username = response["preferredUsername"]
|
||||||
self.display_name = response.get("name", self.username)
|
self.display_name = response.get("name", self.username)
|
||||||
|
if not self.display_name:
|
||||||
|
self.display_name = self.username
|
||||||
self.inbox = Inbox(response["inbox"])
|
self.inbox = Inbox(response["inbox"])
|
||||||
self.outbox = Outbox(response["outbox"])
|
self.outbox = Outbox(response["outbox"])
|
||||||
self.followers = response["followers"]
|
self.followers = response["followers"]
|
||||||
|
|
Loading…
Reference in a new issue