From a28f76374e583e6bf5d2f8490a39945a63da418f Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 17 Jun 2022 14:33:26 +0200 Subject: [PATCH 1/3] use get_openpype_username to fill data for templates filling --- openpype/lib/avalon_context.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/lib/avalon_context.py b/openpype/lib/avalon_context.py index 9d8a92cfe9..c27c5f572e 100644 --- a/openpype/lib/avalon_context.py +++ b/openpype/lib/avalon_context.py @@ -7,7 +7,6 @@ import platform import logging import collections import functools -import getpass from bson.objectid import ObjectId @@ -19,6 +18,7 @@ from .anatomy import Anatomy from .profiles_filtering import filter_profiles from .events import emit_event from .path_templates import StringTemplate +from .local_settings import get_openpype_username legacy_io = None @@ -550,7 +550,7 @@ def get_workdir_data(project_doc, asset_doc, task_name, host_name): "asset": asset_doc["name"], "parent": parent_name, "app": host_name, - "user": getpass.getuser(), + "user": get_openpype_username(), "hierarchy": hierarchy, } From cd90fb603ea3815445b9e181374428c2a5c4a18d Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 17 Jun 2022 14:37:38 +0200 Subject: [PATCH 2/3] remove unused imports --- openpype/plugins/publish/collect_current_pype_user.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/openpype/plugins/publish/collect_current_pype_user.py b/openpype/plugins/publish/collect_current_pype_user.py index 1a52a59012..2d507ba292 100644 --- a/openpype/plugins/publish/collect_current_pype_user.py +++ b/openpype/plugins/publish/collect_current_pype_user.py @@ -1,5 +1,3 @@ -import os -import getpass import pyblish.api from openpype.lib import get_openpype_username From 1f42006f571343cf832b078d453e6804d68a3cbd Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 17 Jun 2022 14:38:03 +0200 Subject: [PATCH 3/3] added user key to available template keys --- website/docs/admin_settings_project_anatomy.md | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/admin_settings_project_anatomy.md b/website/docs/admin_settings_project_anatomy.md index 6e0b49f152..106faeb806 100644 --- a/website/docs/admin_settings_project_anatomy.md +++ b/website/docs/admin_settings_project_anatomy.md @@ -68,6 +68,7 @@ We have a few required anatomy templates for OpenPype to work properly, however | `representation` | Representation name | | `frame` | Frame number for sequence files. | | `app` | Application Name | +| `user` | User's login name (can be overridden in local settings) | | `output` | | | `comment` | |