combile public and unlisted in reply
This commit is contained in:
parent
c5814b5c60
commit
64ec54296a
2 changed files with 5 additions and 13 deletions
|
@ -50,20 +50,11 @@
|
|||
<label>
|
||||
<input type="radio"
|
||||
name="visibility"
|
||||
value="0"
|
||||
{% if post.visibility == 0 %}checked{% endif %} />
|
||||
value="{% if request.user.preference.mastodon_publish_public %}0{% else %}1{% endif %}"
|
||||
{% if post.visibility <= 1 %}checked{% endif %} />
|
||||
<i class="fa-solid fa-globe"></i>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label>
|
||||
<input type="radio"
|
||||
name="visibility"
|
||||
value="1"
|
||||
{% if post.visibility == 1 %}checked{% endif %} />
|
||||
<i class="fa-solid fa-lock-open"></i>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label>
|
||||
<input type="radio"
|
||||
|
|
|
@ -6,6 +6,7 @@ from django.core.cache import cache
|
|||
from .models import *
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from journal.models import Collection
|
||||
from users.models import APIdentity
|
||||
from users.models import User as NeoUser
|
||||
|
||||
|
@ -426,11 +427,11 @@ class Takahe:
|
|||
return Takahe.Visibilities.unlisted
|
||||
|
||||
@staticmethod
|
||||
def post_collection(collection):
|
||||
def post_collection(collection: "Collection"):
|
||||
existing_post = collection.latest_post
|
||||
user = collection.owner.user
|
||||
visibility = Takahe.visibility_n2t(
|
||||
collection, user.preference.mastodon_publish_public
|
||||
collection.visibility, user.preference.mastodon_publish_public
|
||||
)
|
||||
if existing_post and visibility != existing_post.visibility:
|
||||
Takahe.delete_posts([existing_post])
|
||||
|
|
Loading…
Add table
Reference in a new issue