We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b76a9f commit fa5738aCopy full SHA for fa5738a
src/agent_toolkit/forestadmin/agent_toolkit/services/serializers/json_api.py
@@ -155,10 +155,12 @@ def schema(self) -> "ForestSchema":
155
)
156
157
def get_related_url(self, obj: Any):
158
- if "data" in obj:
+ if "id" in obj:
159
+ obj["__forest_id__"] = obj["id"]
160
+ elif "data" in obj:
161
obj["__forest_id__"] = obj["data"]["id"]
162
else:
- obj["__forest_id__"] = obj["id"]
163
+ raise JsonApiException("Cannot find json api 'id' in given obj.")
164
res: Any = super(ForestRelationShip, self).get_related_url(obj) # type: ignore
165
del obj["__forest_id__"]
166
return {"href": res}
0 commit comments