From 1bcdff79e7e14b2166056d3b16531b32474c374b Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Thu, 15 Dec 2022 19:26:06 -0700 Subject: Fix hashtag linking and API mentions of empty --- activities/models/post.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'activities/models/post.py') diff --git a/activities/models/post.py b/activities/models/post.py index df80457..b5821f7 100644 --- a/activities/models/post.py +++ b/activities/models/post.py @@ -348,7 +348,8 @@ class Post(StatorModel): Returns the content formatted for remote consumption """ return Hashtag.linkify_hashtags( - self.linkify_mentions(sanitize_post(self.content)) + self.linkify_mentions(sanitize_post(self.content)), + domain=self.author.domain, ) def safe_content_plain(self): @@ -835,9 +836,9 @@ class Post(StatorModel): "mentions": [ { "id": mention.id, - "username": mention.username, - "url": mention.absolute_profile_uri(), - "acct": mention.handle, + "username": mention.username or "", + "url": mention.absolute_profile_uri() or "", + "acct": mention.handle or "", } for mention in self.mentions.all() if mention.username -- cgit v1.2.3