Fixes status views tests

This commit is contained in:
Mouse Reeve
2021-03-23 08:13:57 -07:00
parent e17ee40800
commit ea71c2aa88
2 changed files with 47 additions and 16 deletions

View File

@ -184,7 +184,12 @@ streams = {
def add_status_on_create(sender, instance, created, *args, **kwargs):
""" add newly created statuses to activity feeds """
# we're only interested in new statuses
if not created or not issubclass(sender, models.Status):
if not issubclass(sender, models.Status):
return
if not created and instance.deleted:
for stream in streams.values():
stream.remove_status(instance)
return
# iterates through Home, Local, Federated