From d60ba9a0515aed0b8235a7738a5fecd8fd78f859 Mon Sep 17 00:00:00 2001 From: Michael Manfre Date: Fri, 25 Nov 2022 21:33:46 -0500 Subject: Added default post visibility --- activities/models/post.py | 2 +- activities/views/posts.py | 3 +++ activities/views/timelines.py | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) (limited to 'activities') diff --git a/activities/models/post.py b/activities/models/post.py index 642842c..dd82bcf 100644 --- a/activities/models/post.py +++ b/activities/models/post.py @@ -499,7 +499,7 @@ class Post(StatorModel): @classmethod def handle_delete_ap(cls, data): """ - Handles an incoming create request + Handles an incoming delete request """ with transaction.atomic(): # Find our post by ID if we have one diff --git a/activities/views/posts.py b/activities/views/posts.py index 268a3fe..8cd91a1 100644 --- a/activities/views/posts.py +++ b/activities/views/posts.py @@ -202,6 +202,9 @@ class Compose(FormView): def get_initial(self): initial = super().get_initial() + initial[ + "visibility" + ] = self.request.identity.config_identity.default_post_visibility if self.reply_to: initial["reply_to"] = self.reply_to.pk initial["visibility"] = Post.Visibilities.unlisted diff --git a/activities/views/timelines.py b/activities/views/timelines.py index b680c8a..4f2a515 100644 --- a/activities/views/timelines.py +++ b/activities/views/timelines.py @@ -56,6 +56,7 @@ class Home(FormView): author=self.request.identity, content=linebreaks_filter(form.cleaned_data["text"]), summary=form.cleaned_data.get("content_warning"), + visibility=self.request.identity.config_identity.default_post_visibility, ) return redirect(".") -- cgit v1.2.3