use AYON username for user in template data

This commit is contained in:
Jakub Trllo 2023-10-31 13:55:22 +01:00
parent 5e1de5fd7a
commit 00fb722089
2 changed files with 13 additions and 1 deletions

View file

@ -611,6 +611,12 @@ def get_openpype_username():
settings and last option is to use `getpass.getuser()` which returns
machine username.
"""
if AYON_SERVER_ENABLED:
import ayon_api
return ayon_api.get_user()["name"]
username = os.environ.get("OPENPYPE_USERNAME")
if not username:
local_settings = get_local_settings()