mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-27 14:22:37 +01:00
get_openpype_username replaced usage of OPENPYPE_USERNAME environment in code
This commit is contained in:
parent
fee9e9bd56
commit
7d9e665e2d
3 changed files with 22 additions and 21 deletions
|
|
@ -79,6 +79,16 @@ from .avalon_context import (
|
|||
change_timer_to_current_context
|
||||
)
|
||||
|
||||
from .local_settings import (
|
||||
IniSettingRegistry,
|
||||
JSONSettingRegistry,
|
||||
OpenPypeSecureRegistry,
|
||||
OpenPypeSettingsRegistry,
|
||||
get_local_site_id,
|
||||
change_openpype_mongo_url,
|
||||
get_openpype_username
|
||||
)
|
||||
|
||||
from .applications import (
|
||||
ApplicationLaunchFailed,
|
||||
ApplictionExecutableNotFound,
|
||||
|
|
@ -112,15 +122,6 @@ from .plugin_tools import (
|
|||
should_decompress
|
||||
)
|
||||
|
||||
from .local_settings import (
|
||||
IniSettingRegistry,
|
||||
JSONSettingRegistry,
|
||||
OpenPypeSecureRegistry,
|
||||
OpenPypeSettingsRegistry,
|
||||
get_local_site_id,
|
||||
change_openpype_mongo_url
|
||||
)
|
||||
|
||||
from .path_tools import (
|
||||
version_up,
|
||||
get_version_from_path,
|
||||
|
|
@ -179,6 +180,14 @@ __all__ = [
|
|||
|
||||
"change_timer_to_current_context",
|
||||
|
||||
"IniSettingRegistry",
|
||||
"JSONSettingRegistry",
|
||||
"OpenPypeSecureRegistry",
|
||||
"OpenPypeSettingsRegistry",
|
||||
"get_local_site_id",
|
||||
"change_openpype_mongo_url",
|
||||
"get_openpype_username",
|
||||
|
||||
"ApplicationLaunchFailed",
|
||||
"ApplictionExecutableNotFound",
|
||||
"ApplicationNotFound",
|
||||
|
|
@ -224,13 +233,6 @@ __all__ = [
|
|||
"validate_mongo_connection",
|
||||
"OpenPypeMongoConnection",
|
||||
|
||||
"IniSettingRegistry",
|
||||
"JSONSettingRegistry",
|
||||
"OpenPypeSecureRegistry",
|
||||
"OpenPypeSettingsRegistry",
|
||||
"get_local_site_id",
|
||||
"change_openpype_mongo_url",
|
||||
|
||||
"timeit",
|
||||
|
||||
"is_overlapping_otio_ranges",
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ from . import (
|
|||
PypeLogger,
|
||||
Anatomy
|
||||
)
|
||||
from .local_settings import get_openpype_username
|
||||
from .avalon_context import (
|
||||
get_workdir_data,
|
||||
get_workdir_with_workdir_data
|
||||
|
|
@ -1224,7 +1225,7 @@ def _prepare_last_workfile(data, workdir):
|
|||
file_template = anatomy.templates["work"]["file"]
|
||||
workdir_data.update({
|
||||
"version": 1,
|
||||
"user": os.environ.get("OPENPYPE_USERNAME") or getpass.getuser(),
|
||||
"user": get_openpype_username(),
|
||||
"ext": extensions[0]
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import os
|
||||
import getpass
|
||||
import pyblish.api
|
||||
from openpype.lib import get_openpype_username
|
||||
|
||||
|
||||
class CollectCurrentUserPype(pyblish.api.ContextPlugin):
|
||||
|
|
@ -11,9 +12,6 @@ class CollectCurrentUserPype(pyblish.api.ContextPlugin):
|
|||
label = "Collect Pype User"
|
||||
|
||||
def process(self, context):
|
||||
user = os.getenv("OPENPYPE_USERNAME", "").strip()
|
||||
if not user:
|
||||
user = context.data.get("user", getpass.getuser())
|
||||
|
||||
user = get_openpype_username()
|
||||
context.data["user"] = user
|
||||
self.log.debug("Colected user \"{}\"".format(user))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue