mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Ftrack app action expect avalon mongo object on initialization
This commit is contained in:
parent
a9c575e838
commit
b5ba616ce2
1 changed files with 6 additions and 2 deletions
|
|
@ -20,7 +20,7 @@ class AppAction(BaseAction):
|
|||
preactions = ["start.timer"]
|
||||
|
||||
def __init__(
|
||||
self, session, label, name, executable, variant=None,
|
||||
self, session, dbcon, label, name, executable, variant=None,
|
||||
icon=None, description=None, preactions=[], plugins_presets={}
|
||||
):
|
||||
self.label = label
|
||||
|
|
@ -31,6 +31,8 @@ class AppAction(BaseAction):
|
|||
self.description = description
|
||||
self.preactions.extend(preactions)
|
||||
|
||||
self.dbcon = dbcon
|
||||
|
||||
super().__init__(session, plugins_presets)
|
||||
if label is None:
|
||||
raise ValueError("Action missing label.")
|
||||
|
|
@ -89,8 +91,10 @@ class AppAction(BaseAction):
|
|||
if avalon_project_apps is None:
|
||||
if avalon_project_doc is None:
|
||||
ft_project = self.get_project_from_entity(entity)
|
||||
database = pypelib.get_avalon_database()
|
||||
project_name = ft_project["full_name"]
|
||||
|
||||
self.dbcon.install()
|
||||
database = self.dbcon.database
|
||||
avalon_project_doc = database[project_name].find_one({
|
||||
"type": "project"
|
||||
}) or False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue