From 1db9d9e247d2fe1259350c8dc14b2446720a6909 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 10 Aug 2020 17:09:17 +0100 Subject: [PATCH] fix delivery action variable and create directories --- pype/modules/ftrack/actions/action_delivery.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pype/modules/ftrack/actions/action_delivery.py b/pype/modules/ftrack/actions/action_delivery.py index 231aebdf7a..7dbb7c65e8 100644 --- a/pype/modules/ftrack/actions/action_delivery.py +++ b/pype/modules/ftrack/actions/action_delivery.py @@ -11,7 +11,7 @@ from avalon.vendor import filelink from pype.api import Anatomy from pype.modules.ftrack.lib import BaseAction, statics_icon -from pype.modules.ftrack.lib.avalon_sync import CUST_ATTR_ID_KEY +from pype.modules.ftrack.lib.avalon_sync import CustAttrIdKey from pype.modules.ftrack.lib.io_nonsingleton import DbConnector @@ -228,12 +228,7 @@ class Delivery(BaseAction): if location_path: location_path = os.path.normpath(location_path) if not os.path.exists(location_path): - return { - "success": False, - "message": ( - "Entered location path does not exists. \"{}\"" - ).format(location_path) - } + os.makedirs(location_path) self.db_con.install() self.db_con.Session["AVALON_PROJECT"] = project_name @@ -245,7 +240,7 @@ class Delivery(BaseAction): version = entity["version"] parent = asset["parent"] - parent_mongo_id = parent["custom_attributes"].get(CUST_ATTR_ID_KEY) + parent_mongo_id = parent["custom_attributes"].get(CustAttrIdKey) if parent_mongo_id: parent_mongo_id = ObjectId(parent_mongo_id) else: