mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
added simple check of task existence when template requires task name
This commit is contained in:
parent
ad3458c232
commit
2fbf01856a
1 changed files with 12 additions and 0 deletions
|
|
@ -11,6 +11,13 @@ ValidateSceneOrder = pyblish.api.ValidatorOrder + 0.2
|
|||
ValidateMeshOrder = pyblish.api.ValidatorOrder + 0.3
|
||||
|
||||
|
||||
class TaskNotSetError(KeyError):
|
||||
def __init__(self, msg=None):
|
||||
if not msg:
|
||||
msg = "Creator's subset name template requires task name."
|
||||
super(TaskNotSetError, self).__init__(msg)
|
||||
|
||||
|
||||
class PypeCreatorMixin:
|
||||
"""Helper to override avalon's default class methods.
|
||||
|
||||
|
|
@ -53,6 +60,11 @@ class PypeCreatorMixin:
|
|||
if not template:
|
||||
template = cls.default_tempate
|
||||
|
||||
# Simple check of task name existence for template with {task} in
|
||||
# - missing task should be possible only in Standalone publisher
|
||||
if not task_name and "{task}" in template:
|
||||
raise TaskNotSetError()
|
||||
|
||||
fill_data = {
|
||||
"user_input": user_text,
|
||||
"userInput": user_text,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue