Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #6187 from ynput/bugfix/always-use-bundle-name-as-…
Browse files Browse the repository at this point in the history
…dev-variant

AYON settings: Use bundle name as variant in dev mode
  • Loading branch information
iLLiCiTiT authored Feb 1, 2024
2 parents 56772fe + f709a86 commit 7b3d54a
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions openpype/settings/ayon_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1458,7 +1458,7 @@ def _get_variant(cls):

variant = "production"
if is_dev_mode_enabled():
variant = cls._get_dev_mode_settings_variant()
variant = cls._get_bundle_name()
elif is_staging_enabled():
variant = "staging"

Expand All @@ -1474,28 +1474,6 @@ def _get_variant(cls):
def _get_bundle_name(cls):
return os.environ["AYON_BUNDLE_NAME"]

@classmethod
def _get_dev_mode_settings_variant(cls):
"""Develop mode settings variant.
Returns:
str: Name of settings variant.
"""

con = get_ayon_server_api_connection()
bundles = con.get_bundles()
user = con.get_user()
username = user["name"]
for bundle in bundles["bundles"]:
if (
bundle.get("isDev")
and bundle.get("activeUser") == username
):
return bundle["name"]
# Return fake variant - distribution logic will tell user that he
# does not have set any dev bundle
return "dev"

@classmethod
def get_value_by_project(cls, project_name):
cache_item = _AyonSettingsCache.cache_by_project_name[project_name]
Expand Down

0 comments on commit 7b3d54a

Please sign in to comment.