Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Check asset is 'not selected'
Browse files Browse the repository at this point in the history
  • Loading branch information
2-REC committed Dec 5, 2022
1 parent 605432c commit ba149de
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions openpype/tools/standalonepublish/widgets/widget_family.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,11 @@ def _on_data_changed(self):
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 ..")
Expand All @@ -207,8 +202,10 @@ def _on_data_changed(self):
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"]
Expand Down

0 comments on commit ba149de

Please sign in to comment.