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:
MineRobber___T 2020-01-16 11:13:23 -05:00 committed by GitHub
parent 3f916fc558
commit 42b632eff3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,6 +18,8 @@ class Actor(object):
response = response.json()
self.username = response["preferredUsername"]
self.display_name = response.get("name", self.username)
if not self.display_name:
self.display_name = self.username
self.inbox = Inbox(response["inbox"])
self.outbox = Outbox(response["outbox"])
self.followers = response["followers"]