mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
feat(global): adding validator instance versions
This commit is contained in:
parent
88c5d06789
commit
539d772788
1 changed files with 18 additions and 0 deletions
18
pype/plugins/global/publish/validate_version.py
Normal file
18
pype/plugins/global/publish/validate_version.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import pyblish
|
||||
|
||||
|
||||
class ValidateVersion(pyblish.api.InstancePlugin):
|
||||
"""Validate instance version.
|
||||
|
||||
Pype is not allowing overwiting previously published versions.
|
||||
"""
|
||||
|
||||
order = pyblish.api.ValidatorOrder
|
||||
|
||||
label = "Validate Version"
|
||||
|
||||
def process(self, instance):
|
||||
version = int(instance.data.get("version"))
|
||||
last_version = int(instance.data.get("lastVersion"))
|
||||
|
||||
assert (version != last_version), "This workfile version is already in published: database: `{0}`, workfile: `{1}`".format(last_version, version)
|
||||
Loading…
Add table
Add a link
Reference in a new issue