mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-12-22 11:11:09 +00:00
handle TypeError in Message.object_id
This commit is contained in:
parent
b9eb67b32d
commit
2ebb295be1
|
@ -251,6 +251,16 @@ class Message(ApMessage):
|
|||
})
|
||||
|
||||
|
||||
# todo: remove when fixed in aputils
|
||||
@property
|
||||
def object_id(self) -> str:
|
||||
try:
|
||||
return self["object"]["id"]
|
||||
|
||||
except (KeyError, TypeError):
|
||||
return self["object"]
|
||||
|
||||
|
||||
class Response(AiohttpResponse):
|
||||
@classmethod
|
||||
def new(cls: Type[Response],
|
||||
|
|
Loading…
Reference in a new issue