From 35a45f1c55fba69d690929c9420df565e7c5efcc Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Mon, 12 Dec 2022 00:54:51 -0700 Subject: A few more fixes and a bad test --- activities/models/post.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'activities/models') diff --git a/activities/models/post.py b/activities/models/post.py index da5a98b..8e355bf 100644 --- a/activities/models/post.py +++ b/activities/models/post.py @@ -784,13 +784,20 @@ class Post(StatorModel): reply_parent = None if self.in_reply_to: reply_parent = Post.objects.filter(object_uri=self.in_reply_to).first() + visibility_mapping = { + self.Visibilities.public: "public", + self.Visibilities.unlisted: "unlisted", + self.Visibilities.followers: "private", + self.Visibilities.mentioned: "direct", + self.Visibilities.local_only: "public", + } value = { "id": self.pk, "uri": self.object_uri, "created_at": format_ld_date(self.published), "account": self.author.to_mastodon_json(), "content": self.safe_content_remote(), - "visibility": "public", + "visibility": visibility_mapping[self.visibility], "sensitive": self.sensitive, "spoiler_text": self.summary or "", "media_attachments": [ -- cgit v1.2.3