mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-10 02:17:59 +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):
|
class Response(AiohttpResponse):
|
||||||
@classmethod
|
@classmethod
|
||||||
def new(cls: Type[Response],
|
def new(cls: Type[Response],
|
||||||
|
|
Loading…
Reference in a new issue