mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
use AYON username for user in template data
This commit is contained in:
parent
5e1de5fd7a
commit
00fb722089
2 changed files with 13 additions and 1 deletions
|
|
@ -611,6 +611,12 @@ def get_openpype_username():
|
||||||
settings and last option is to use `getpass.getuser()` which returns
|
settings and last option is to use `getpass.getuser()` which returns
|
||||||
machine username.
|
machine username.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if AYON_SERVER_ENABLED:
|
||||||
|
import ayon_api
|
||||||
|
|
||||||
|
return ayon_api.get_user()["name"]
|
||||||
|
|
||||||
username = os.environ.get("OPENPYPE_USERNAME")
|
username = os.environ.get("OPENPYPE_USERNAME")
|
||||||
if not username:
|
if not username:
|
||||||
local_settings = get_local_settings()
|
local_settings = get_local_settings()
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
import pyblish.api
|
import pyblish.api
|
||||||
|
|
||||||
|
from openpype import AYON_SERVER_ENABLED
|
||||||
from openpype.lib import get_openpype_username
|
from openpype.lib import get_openpype_username
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -7,7 +9,11 @@ class CollectCurrentUserPype(pyblish.api.ContextPlugin):
|
||||||
|
|
||||||
# Order must be after default pyblish-base CollectCurrentUser
|
# Order must be after default pyblish-base CollectCurrentUser
|
||||||
order = pyblish.api.CollectorOrder + 0.001
|
order = pyblish.api.CollectorOrder + 0.001
|
||||||
label = "Collect Pype User"
|
label = (
|
||||||
|
"Collect AYON User"
|
||||||
|
if AYON_SERVER_ENABLED
|
||||||
|
else "Collect OpenPype User"
|
||||||
|
)
|
||||||
|
|
||||||
def process(self, context):
|
def process(self, context):
|
||||||
user = get_openpype_username()
|
user = get_openpype_username()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue