diff options
author | Andrew Godwin | 2022-12-12 00:54:51 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-12-12 11:56:49 -0700 |
commit | 35a45f1c55fba69d690929c9420df565e7c5efcc (patch) | |
tree | 0969cf0b9b6c2dec04ec16d0d7444ebff744e377 /activities/models | |
parent | 7f02d51ba04a533391a2c09b5f780fc8b0193ef7 (diff) | |
download | takahe-35a45f1c55fba69d690929c9420df565e7c5efcc.tar.gz takahe-35a45f1c55fba69d690929c9420df565e7c5efcc.tar.bz2 takahe-35a45f1c55fba69d690929c9420df565e7c5efcc.zip |
A few more fixes and a bad test
Diffstat (limited to 'activities/models')
-rw-r--r-- | activities/models/post.py | 9 |
1 files changed, 8 insertions, 1 deletions
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": [ |