Broadcast user deletions
This commit is contained in:
@ -241,7 +241,7 @@ class ObjectMixin(ActivitypubMixin):
|
||||
return
|
||||
|
||||
# is this a deletion?
|
||||
if hasattr(self, "deleted") and self.deleted:
|
||||
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)
|
||||
|
@ -283,6 +283,12 @@ class User(OrderedCollectionPageMixin, AbstractUser):
|
||||
editable=False,
|
||||
).save(broadcast=False)
|
||||
|
||||
def delete(self, *args, **kwargs):
|
||||
""" deactivate rather than delete a user """
|
||||
self.is_active = False
|
||||
# skip the logic in this class's save()
|
||||
super().save(*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