From faca9224edf82bc84c9b076d262c7d19cc976b03 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Thu, 15 Dec 2022 18:59:04 -0700 Subject: Handle API identities with no name --- users/models/identity.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'users/models') diff --git a/users/models/identity.py b/users/models/identity.py index 7898b4a..4ebf69f 100644 --- a/users/models/identity.py +++ b/users/models/identity.py @@ -505,10 +505,10 @@ class Identity(StatorModel): ) return { "id": self.pk, - "username": self.username, + "username": self.username or "", "acct": self.username if self.local else self.handle, "url": self.absolute_profile_uri(), - "display_name": self.name, + "display_name": self.name or "", "note": self.summary or "", "avatar": self.local_icon_url().absolute, "avatar_static": self.local_icon_url().absolute, -- cgit v1.2.3