mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
added catch exception when task is required and not set
This commit is contained in:
parent
2fbf01856a
commit
7fe8f85a62
1 changed files with 18 additions and 13 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import os
|
||||
import re
|
||||
from collections import namedtuple
|
||||
|
||||
from Qt import QtWidgets, QtCore
|
||||
from . import HelpRole, FamilyRole, ExistsRole, PluginRole, PluginKeyRole
|
||||
|
|
@ -10,6 +9,7 @@ from pype.api import (
|
|||
get_project_settings,
|
||||
Creator
|
||||
)
|
||||
from pype.plugin import TaskNotSetError
|
||||
from avalon.tools.creator.app import SubsetAllowedSymbols
|
||||
|
||||
|
||||
|
|
@ -214,18 +214,23 @@ class FamilyWidget(QtWidgets.QWidget):
|
|||
task_name = self.dbcon.Session["AVALON_TASK"]
|
||||
|
||||
# Calculate subset name with Creator plugin
|
||||
subset_name = plugin.get_subset_name(
|
||||
user_input_text, task_name, asset_id, project_name
|
||||
)
|
||||
# Force replacement of prohibited symbols
|
||||
# QUESTION should Creator care about this and here should be only
|
||||
# validated with schema regex?
|
||||
subset_name = re.sub(
|
||||
"[^{}]+".format(SubsetAllowedSymbols),
|
||||
"",
|
||||
subset_name
|
||||
)
|
||||
self.input_result.setText(subset_name)
|
||||
try:
|
||||
subset_name = plugin.get_subset_name(
|
||||
user_input_text, task_name, asset_id, project_name
|
||||
)
|
||||
# Force replacement of prohibited symbols
|
||||
# QUESTION should Creator care about this and here should be only
|
||||
# validated with schema regex?
|
||||
subset_name = re.sub(
|
||||
"[^{}]+".format(SubsetAllowedSymbols),
|
||||
"",
|
||||
subset_name
|
||||
)
|
||||
self.input_result.setText(subset_name)
|
||||
|
||||
except TaskNotSetError:
|
||||
subset_name = ""
|
||||
self.input_result.setText("Select task please")
|
||||
|
||||
# Get all subsets of the current asset
|
||||
subset_docs = self.dbcon.find(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue