diff options
Diffstat (limited to 'users/models')
-rw-r--r-- | users/models/identity.py | 4 | ||||
-rw-r--r-- | users/models/inbox_message.py | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/users/models/identity.py b/users/models/identity.py index 452bde7..a78a451 100644 --- a/users/models/identity.py +++ b/users/models/identity.py @@ -277,7 +277,7 @@ class Identity(StatorModel): headers={"Accept": "application/json"}, follow_redirects=True, ) - except (httpx.ReadTimeout, httpx.ReadError, httpx.RemoteProtocolError): + except httpx.RequestError: return None, None if response.status_code >= 400: return None, None @@ -306,7 +306,7 @@ class Identity(StatorModel): headers={"Accept": "application/json"}, follow_redirects=True, ) - except (httpx.ReadTimeout, httpx.ReadError, httpx.RemoteProtocolError): + except httpx.RequestError: return False if response.status_code >= 400: return False 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) |