mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 13:24:54 +01:00
feat(global): improving logic
This commit is contained in:
parent
ab65bb1818
commit
71a3e111ef
1 changed files with 8 additions and 3 deletions
|
|
@ -10,9 +10,14 @@ class ValidateVersion(pyblish.api.InstancePlugin):
|
|||
order = pyblish.api.ValidatorOrder
|
||||
|
||||
label = "Validate Version"
|
||||
hosts = ["nuke", "maya", "blender"]
|
||||
|
||||
def process(self, instance):
|
||||
version = int(instance.data.get("version"))
|
||||
last_version = int(instance.data.get("lastVersion"))
|
||||
version = int(instance.data.get("version")
|
||||
latest_version = int(instance.data.get("latestVersion", 0))
|
||||
|
||||
assert (version != last_version), "This workfile version is already in published: database: `{0}`, workfile: `{1}`".format(last_version, version)
|
||||
assert (version != latest_version), ("Version `{0}` that you are"
|
||||
" trying to publish, already"
|
||||
" exists in the"
|
||||
" database `{1}`.").format(
|
||||
version, latest_version)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue