mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-09 18:08:00 +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