From a1387fef9e9db78197e2ba1238ef571123c8cfde Mon Sep 17 00:00:00 2001 From: mein Name Date: Sat, 8 Feb 2025 15:20:52 -0500 Subject: [PATCH] fix api for item/post --- journal/apis/post.py | 4 ++-- takahe/models.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/journal/apis/post.py b/journal/apis/post.py index ff3698f1..556d97f0 100644 --- a/journal/apis/post.py +++ b/journal/apis/post.py @@ -30,8 +30,8 @@ class Account(Schema): note: str avatar: str avatar_static: str - header: str | None = Field(...) - header_static: str | None = Field(...) + header: str + header_static: str locked: bool fields: list[AccountField] emojis: list[CustomEmoji] diff --git a/takahe/models.py b/takahe/models.py index e997cba9..384263c0 100644 --- a/takahe/models.py +++ b/takahe/models.py @@ -789,23 +789,23 @@ class Identity(models.Model): else: return f"/proxy/identity_icon/{self.pk}/" - def local_image_url(self) -> RelativeAbsoluteUrl | None: + def local_image_url(self) -> str | None: """ Returns a background image for us, returning None if there isn't one """ if self.image: - return AutoAbsoluteUrl(self.image.url) + return AutoAbsoluteUrl(self.image.url).absolute elif self.image_uri: return ProxyAbsoluteUrl( f"/proxy/identity_image/{self.pk}/", remote_url=self.image_uri, - ) + ).absolute return None def to_mastodon_json(self, source=False): missing = StaticAbsoluteUrl("img/missing.png").absolute header_image = self.local_image_url() or missing - icon_image = self.local_icon_url() + icon_image = self.local_icon_url() or missing metadata_value_text = ( " ".join([m["value"] for m in self.metadata]) if self.metadata else "" )