mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 17:04:54 +01:00
reversed condition of raising exception
This commit is contained in:
parent
cc8119ff1a
commit
2ebbefdec0
1 changed files with 8 additions and 8 deletions
|
|
@ -31,20 +31,20 @@ class CollectMatchingAssetToInstance(pyblish.api.InstancePlugin):
|
|||
matching_asset_doc = asset_doc
|
||||
break
|
||||
|
||||
if matching_asset_doc:
|
||||
instance.data["asset"] = matching_asset_doc["name"]
|
||||
instance.data["assetEntity"] = matching_asset_doc
|
||||
self.log.info(
|
||||
f"Matching asset found: {pformat(matching_asset_doc)}"
|
||||
)
|
||||
|
||||
else:
|
||||
if not matching_asset_doc:
|
||||
# TODO better error message
|
||||
raise AssertionError((
|
||||
"Filename \"{}\" does not match"
|
||||
" any name of asset documents in database for your selection."
|
||||
).format(instance.data["source"]))
|
||||
|
||||
instance.data["asset"] = matching_asset_doc["name"]
|
||||
instance.data["assetEntity"] = matching_asset_doc
|
||||
|
||||
self.log.info(
|
||||
f"Matching asset found: {pformat(matching_asset_doc)}"
|
||||
)
|
||||
|
||||
def selection_children_by_name(self, instance):
|
||||
storing_key = "childrenDocsForSelection"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue