Broadcast deletions
This commit is contained in:
@ -241,7 +241,11 @@ class ObjectMixin(ActivitypubMixin):
|
||||
return
|
||||
|
||||
# is this a deletion?
|
||||
if (hasattr(self, "deleted") and self.deleted) or hasattr(self, "is_active") and not self.is_active:
|
||||
if (
|
||||
(hasattr(self, "deleted") and self.deleted)
|
||||
or hasattr(self, "is_active")
|
||||
and not self.is_active
|
||||
):
|
||||
activity = self.to_delete_activity(user)
|
||||
else:
|
||||
activity = self.to_update_activity(user)
|
||||
|
@ -289,6 +289,12 @@ class User(OrderedCollectionPageMixin, AbstractUser):
|
||||
# skip the logic in this class's save()
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
def to_activity(self, *args, **kwargs):
|
||||
""" return a remote_id only if the user is inactive """
|
||||
if not self.is_active:
|
||||
return self.remote_id
|
||||
return super().to_activity_dataclass(*args, **kwargs)
|
||||
|
||||
@property
|
||||
def local_path(self):
|
||||
""" this model doesn't inherit bookwyrm model, so here we are """
|
||||
|
Reference in New Issue
Block a user