fix edge cases when posting note

This commit is contained in:
Your Name 2024-06-16 15:35:46 -04:00 committed by Henri Dickson
parent c6d1a76e95
commit 56aa6aa0b9
2 changed files with 9 additions and 3 deletions

View file

@ -190,14 +190,13 @@ class Note(Content):
def to_post_params(self):
footer = f'\n<p>—<br><a href="{self.item.absolute_url}">{self.item.display_title}</a> {self.progress_display}\n</p>'
post = self.shelfmember.latest_post if self.shelfmember else None
return {
"summary": self.title,
"content": self.content,
"append_content": footer,
"sensitive": self.sensitive,
"reply_to_pk": (
self.shelfmember.latest_post_id if self.shelfmember else None
),
"reply_to_pk": post.pk if post else None,
# not passing "attachments" so it won't change
}

View file

@ -496,6 +496,13 @@ class Takahe:
reply_to=reply_to_post,
attachments=attachments,
)
TimelineEvent.objects.get_or_create(
identity=identity,
type="post",
subject_post=post,
subject_identity=identity,
defaults={"published": post_time},
)
return post
@staticmethod