fix 'get_remote_versions' call in version entity

This commit is contained in:
Jakub Trllo 2022-10-13 15:26:30 +02:00
parent 7bd7c0391c
commit 9330d92fdc
3 changed files with 7 additions and 22 deletions

View file

@ -123,10 +123,7 @@ from .dict_conditional import (
)
from .anatomy_entities import AnatomyEntity
from .op_version_entity import (
ProductionVersionsInputEntity,
StagingVersionsInputEntity
)
from .op_version_entity import VersionsInputEntity
__all__ = (
"DefaultsNotDefined",
@ -188,6 +185,5 @@ __all__ = (
"AnatomyEntity",
"ProductionVersionsInputEntity",
"StagingVersionsInputEntity"
"VersionsInputEntity",
)

View file

@ -66,24 +66,13 @@ class OpenPypeVersionInput(TextEntity):
return super(OpenPypeVersionInput, self).convert_to_valid_type(value)
class ProductionVersionsInputEntity(OpenPypeVersionInput):
class VersionsInputEntity(OpenPypeVersionInput):
"""Entity meant only for global settings to define production version."""
schema_types = ["production-versions-text"]
schema_types = ["versions-text"]
def _get_openpype_versions(self):
versions = get_remote_versions(staging=False, production=True)
versions = get_remote_versions()
if versions is None:
return []
versions.append(get_installed_version())
return sorted(versions)
class StagingVersionsInputEntity(OpenPypeVersionInput):
"""Entity meant only for global settings to define staging version."""
schema_types = ["staging-versions-text"]
def _get_openpype_versions(self):
versions = get_remote_versions(staging=True, production=False)
if versions is None:
return []
return sorted(versions)

View file

@ -146,12 +146,12 @@
"label": "Define explicit OpenPype version that should be used. Keep empty to use latest available version."
},
{
"type": "production-versions-text",
"type": "versions-text",
"key": "production_version",
"label": "Production version"
},
{
"type": "staging-versions-text",
"type": "versions-text",
"key": "staging_version",
"label": "Staging version"
},