diff options
author | Andrew Godwin | 2022-11-20 12:24:03 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-11-20 12:24:03 -0700 |
commit | 77643a4fe144cb908a372a2ceb99f36634457ca5 (patch) | |
tree | 92e37e8a9e242a31d915eb60a0ab0c14bda2bcec /users/models/inbox_message.py | |
parent | facdd2c08094ad378351375541fa8e65459fa8d1 (diff) | |
download | takahe-77643a4fe144cb908a372a2ceb99f36634457ca5.tar.gz takahe-77643a4fe144cb908a372a2ceb99f36634457ca5.tar.bz2 takahe-77643a4fe144cb908a372a2ceb99f36634457ca5.zip |
Add more error handling
Diffstat (limited to 'users/models/inbox_message.py')
-rw-r--r-- | users/models/inbox_message.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/users/models/inbox_message.py b/users/models/inbox_message.py index ee23ae6..fc81d71 100644 --- a/users/models/inbox_message.py +++ b/users/models/inbox_message.py @@ -65,6 +65,9 @@ class InboxMessageStates(StateGraph): f"Cannot handle activity of type undo.{unknown}" ) case "delete": + # If there is no object type, it's probably a profile + if not isinstance(instance.message["object"], dict): + raise ValueError("Cannot handle activity of type delete") match instance.message_object_type: case "tombstone": await sync_to_async(Post.handle_delete_ap)(instance.message) |