use "id" key where id of input is stored instead of "input"

This commit is contained in:
iLLiCiTiT 2021-11-26 12:55:26 +01:00
parent aaca2400a4
commit c728eec8ab
2 changed files with 7 additions and 2 deletions

View file

@ -103,7 +103,7 @@ class IntegrateInputLinks(pyblish.api.ContextPlugin):
# future. # future.
link = OrderedDict() link = OrderedDict()
link["type"] = link_type link["type"] = link_type
link["input"] = io.ObjectId(input_id) link["id"] = io.ObjectId(input_id)
link["linkedBy"] = "publish" link["linkedBy"] = "publish"
if "inputLinks" not in version_doc["data"]: if "inputLinks" not in version_doc["data"]:

View file

@ -37,8 +37,13 @@ class SimpleLinkView(QtWidgets.QWidget):
# inputs # inputs
# #
for link in version_doc["data"].get("inputLinks", []): for link in version_doc["data"].get("inputLinks", []):
# Backwards compatibility for "input" key used as "id"
if "id" not in link:
link_id = link["input"]
else:
link_id = link["id"]
version = self.dbcon.find_one( version = self.dbcon.find_one(
{"_id": link["input"], "type": "version"}, {"_id": link_id, "type": "version"},
projection={"name": 1, "parent": 1} projection={"name": 1, "parent": 1}
) )
if not version: if not version: