From 037ff552e2ef9f5c7e28a5886b2902f0c2895357 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 11 Aug 2020 19:27:13 +0200 Subject: [PATCH] collect matching assets will raise exception only if instance family is psd_batch --- .../publish/collect_matching_asset.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pype/plugins/standalonepublisher/publish/collect_matching_asset.py b/pype/plugins/standalonepublisher/publish/collect_matching_asset.py index 68f07c988d..2c412c9271 100644 --- a/pype/plugins/standalonepublisher/publish/collect_matching_asset.py +++ b/pype/plugins/standalonepublisher/publish/collect_matching_asset.py @@ -29,15 +29,18 @@ class CollectMatchingAssetToInstance(pyblish.api.InstancePlugin): matching_asset_doc = asset_doc break - if not matching_asset_doc: + 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)}" + ) + + # QUESTION exception was limited to "psd_batch" family since + # it is required for processing + elif instance.data["family"] == "psd_batch": # TODO better error message raise AssertionError(( "Filename does not contain any name of" " asset documents in database." )) - - instance.data["asset"] = matching_asset_doc["name"] - instance.data["assetEntity"] = matching_asset_doc - self.log.info( - f"Matching asset found: {pformat(matching_asset_doc)}" - )