fix call and _call methods

This commit is contained in:
iLLiCiTiT 2019-11-28 09:52:56 +01:00
parent 92642639ab
commit 7db7453237
2 changed files with 15 additions and 8 deletions

View file

@ -1731,13 +1731,20 @@ class SyncToAvalonEvent(BaseEvent):
attributes_joined = ", ".join([
"\"{}\"".format(name) for name in hier_cust_attrs_keys
])
[values] = self.process_session._call([{
queries = [{
"action": "query",
"expression": (
"select value, entity_id from CustomAttributeValue "
"where entity_id in ({}) and configuration.key in ({})"
).format(entity_ids_joined, attributes_joined)
}])
}]
if not missing_defaults:
if hasattr(session, "call"):
[values] = session.call(queries)
else:
[values] = session._call(queries)
ftrack_project_id = self.cur_project["id"]
for attr in hier_attrs:

View file

@ -780,10 +780,10 @@ class SyncEntitiesFactory:
entity_ids_joined, attributes_joined
)
}]
if hasattr(self.session, "_call"):
[values] = self.session._call(call_expr)
else:
if hasattr(self.session, "call"):
[values] = self.session.call(call_expr)
else:
[values] = self.session._call(call_expr)
for value in values["data"]:
entity_id = value["entity_id"]
@ -843,10 +843,10 @@ class SyncEntitiesFactory:
"where entity_id in ({}) and configuration.key in ({})"
).format(entity_ids_joined, attributes_joined)
}]
if hasattr(self.session, "_call"):
[values] = self.session._call(call_expr)
else:
if hasattr(self.session, "call"):
[values] = self.session.call(call_expr)
else:
[values] = self.session._call(call_expr)
avalon_hier = []
for value in values["data"]: