summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Godwin2022-11-20 12:36:40 -0700
committerAndrew Godwin2022-11-20 12:36:40 -0700
commit2d7f33879f9319cd47aae0d6fe8486a7c6d0c95b (patch)
treeadd76eb9728ecc4e84a890115366dcdbc4c73629
parentf491fdb56e2de9200e14b855b5576009ca99dfa5 (diff)
downloadtakahe-2d7f33879f9319cd47aae0d6fe8486a7c6d0c95b.tar.gz
takahe-2d7f33879f9319cd47aae0d6fe8486a7c6d0c95b.tar.bz2
takahe-2d7f33879f9319cd47aae0d6fe8486a7c6d0c95b.zip
Actually do deletes right
-rw-r--r--users/models/inbox_message.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/users/models/inbox_message.py b/users/models/inbox_message.py
index a73166a..589f933 100644
--- a/users/models/inbox_message.py
+++ b/users/models/inbox_message.py
@@ -68,13 +68,14 @@ class InboxMessageStates(StateGraph):
# If there is no object type, it's probably a profile
if not isinstance(instance.message["object"], dict):
await sync_to_async(Identity.handle_delete_ap)(instance.message)
- match instance.message_object_type:
- case "tombstone":
- await sync_to_async(Post.handle_delete_ap)(instance.message)
- case unknown:
- raise ValueError(
- f"Cannot handle activity of type delete.{unknown}"
- )
+ else:
+ match instance.message_object_type:
+ case "tombstone":
+ await sync_to_async(Post.handle_delete_ap)(instance.message)
+ case unknown:
+ raise ValueError(
+ f"Cannot handle activity of type delete.{unknown}"
+ )
case unknown:
raise ValueError(f"Cannot handle activity of type {unknown}")
return cls.processed