Adds thread id to status model
This commit is contained in:
@ -57,6 +57,7 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
|
||||
on_delete=models.PROTECT,
|
||||
activitypub_field="inReplyTo",
|
||||
)
|
||||
thread_id = models.IntegerField(blank=True, null=True)
|
||||
objects = InheritanceManager()
|
||||
|
||||
activity_serializer = activitypub.Note
|
||||
@ -68,6 +69,13 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
|
||||
|
||||
ordering = ("-published_date",)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
"""save and notify"""
|
||||
if self.reply_parent:
|
||||
self.thread_id = self.reply_parent.thread_id or self.reply_parent.id
|
||||
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
def delete(self, *args, **kwargs): # pylint: disable=unused-argument
|
||||
""" "delete" a status"""
|
||||
if hasattr(self, "boosted_status"):
|
||||
|
Reference in New Issue
Block a user