mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 13:24:54 +01:00
Check asset is 'not selected'
This commit is contained in:
parent
605432cc5d
commit
ba149de263
1 changed files with 6 additions and 9 deletions
|
|
@ -186,16 +186,11 @@ class FamilyWidget(QtWidgets.QWidget):
|
|||
if item is None:
|
||||
return
|
||||
|
||||
asset_doc = None
|
||||
if asset_name != self.NOT_SELECTED:
|
||||
# Get the assets from the database which match with the name
|
||||
project_name = self.dbcon.active_project()
|
||||
asset_doc = get_asset_by_name(
|
||||
project_name, asset_name, fields=["_id"]
|
||||
)
|
||||
|
||||
# Early exit if no asset name
|
||||
if not asset_name.strip():
|
||||
if (
|
||||
asset_name == self.NOT_SELECTED
|
||||
or not asset_name.strip()
|
||||
):
|
||||
self._build_menu([])
|
||||
item.setData(ExistsRole, False)
|
||||
print("Asset name is required ..")
|
||||
|
|
@ -207,8 +202,10 @@ class FamilyWidget(QtWidgets.QWidget):
|
|||
asset_doc = get_asset_by_name(
|
||||
project_name, asset_name, fields=["_id"]
|
||||
)
|
||||
|
||||
# Get plugin
|
||||
plugin = item.data(PluginRole)
|
||||
|
||||
if asset_doc and plugin:
|
||||
asset_id = asset_doc["_id"]
|
||||
task_name = self.dbcon.Session["AVALON_TASK"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue