From aa9183b2c20ff07485b3987e8fa84504833e13c1 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Mon, 27 Jun 2022 14:23:42 +0200 Subject: [PATCH] use client query function 'get_project' --- openpype/lib/path_tools.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/openpype/lib/path_tools.py b/openpype/lib/path_tools.py index 795866756a..caad20f4d6 100644 --- a/openpype/lib/path_tools.py +++ b/openpype/lib/path_tools.py @@ -6,13 +6,12 @@ import logging import six import platform +from openpype.client import get_project from openpype.settings import get_project_settings from .anatomy import Anatomy from .profiles_filtering import filter_profiles -from openpype.pipeline import AvalonMongoDB - log = logging.getLogger(__name__) @@ -204,9 +203,7 @@ def concatenate_splitted_paths(split_paths, anatomy): def get_format_data(anatomy): - dbcon = AvalonMongoDB() - dbcon.Session["AVALON_PROJECT"] = anatomy.project_name - project_doc = dbcon.find_one({"type": "project"}) + project_doc = get_project(anatomy.project_name, fields=["data.code"]) project_code = project_doc["data"]["code"] return {